Download server/node_modules/jsonwebtoken/lib/timespan.js from Starchik/photo: direct link, hf CLI and curl.
- Browser
- Download file 412 Bytes
-
https://huggingface.co/spaces/Starchik/photo/resolve/main/server/node_modules/jsonwebtoken/lib/timespan.js
- Command line
-
hf download hf://spaces/Starchik/photo/server/node_modules/jsonwebtoken/lib/timespan.js
-
curl -L -o timespan.js https://huggingface.co/spaces/Starchik/photo/resolve/main/server/node_modules/jsonwebtoken/lib/timespan.js
412 Bytes
| var ms = require('ms'); | |
| module.exports = function (time, iat) { | |
| var timestamp = iat || Math.floor(Date.now() / 1000); | |
| if (typeof time === 'string') { | |
| var milliseconds = ms(time); | |
| if (typeof milliseconds === 'undefined') { | |
| return; | |
| } | |
| return Math.floor(timestamp + milliseconds / 1000); | |
| } else if (typeof time === 'number') { | |
| return timestamp + time; | |
| } else { | |
| return; | |
| } | |
| }; |