/usr/lib/nodejs/parse-ms/index.js is in node-parse-ms 1.0.1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | 'use strict';
module.exports = function (ms) {
if (typeof ms !== 'number') {
throw new TypeError('Expected a number');
}
var roundTowardZero = ms > 0 ? Math.floor : Math.ceil;
return {
days: roundTowardZero(ms / 86400000),
hours: roundTowardZero(ms / 3600000) % 24,
minutes: roundTowardZero(ms / 60000) % 60,
seconds: roundTowardZero(ms / 1000) % 60,
milliseconds: roundTowardZero(ms) % 1000
};
};
|