generated from ShadowVR/AI_botter
25 lines
442 B
JavaScript
25 lines
442 B
JavaScript
|
/*!
|
||
|
* humanize-ms - index.js
|
||
|
* Copyright(c) 2014 dead_horse <dead_horse@qq.com>
|
||
|
* MIT Licensed
|
||
|
*/
|
||
|
|
||
|
'use strict';
|
||
|
|
||
|
/**
|
||
|
* Module dependencies.
|
||
|
*/
|
||
|
|
||
|
var util = require('util');
|
||
|
var ms = require('ms');
|
||
|
|
||
|
module.exports = function (t) {
|
||
|
if (typeof t === 'number') return t;
|
||
|
var r = ms(t);
|
||
|
if (r === undefined) {
|
||
|
var err = new Error(util.format('humanize-ms(%j) result undefined', t));
|
||
|
console.warn(err.stack);
|
||
|
}
|
||
|
return r;
|
||
|
};
|