mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-22 11:54:32 +02:00
Remove duplicate dependency ms
This commit is contained in:
parent
6c872263c6
commit
15c6fce648
3 changed files with 8 additions and 183 deletions
|
@ -1,18 +1,17 @@
|
|||
var ms = require('../../ms');
|
||||
const ms = require('ms')
|
||||
|
||||
module.exports = function (time, iat) {
|
||||
var timestamp = iat || Math.floor(Date.now() / 1000);
|
||||
var timestamp = iat || Math.floor(Date.now() / 1000)
|
||||
|
||||
if (typeof time === 'string') {
|
||||
var milliseconds = ms(time);
|
||||
var milliseconds = ms(time)
|
||||
if (typeof milliseconds === 'undefined') {
|
||||
return;
|
||||
return
|
||||
}
|
||||
return Math.floor(timestamp + milliseconds / 1000);
|
||||
return Math.floor(timestamp + milliseconds / 1000)
|
||||
} else if (typeof time === 'number') {
|
||||
return timestamp + time;
|
||||
return timestamp + time
|
||||
} else {
|
||||
return;
|
||||
return
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue