Added some tests
This commit is contained in:
16
tests/node_modules/parse-ms/index.js
generated
vendored
Normal file
16
tests/node_modules/parse-ms/index.js
generated
vendored
Normal file
@@ -0,0 +1,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
|
||||
};
|
||||
};
|
||||
21
tests/node_modules/parse-ms/license
generated
vendored
Normal file
21
tests/node_modules/parse-ms/license
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
66
tests/node_modules/parse-ms/package.json
generated
vendored
Normal file
66
tests/node_modules/parse-ms/package.json
generated
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
{
|
||||
"_from": "parse-ms@^1.0.0",
|
||||
"_id": "parse-ms@1.0.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-VjRtR0nXjyNDDKDHE4UK75GqNh0=",
|
||||
"_location": "/parse-ms",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "parse-ms@^1.0.0",
|
||||
"name": "parse-ms",
|
||||
"escapedName": "parse-ms",
|
||||
"rawSpec": "^1.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/pretty-ms"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-1.0.1.tgz",
|
||||
"_shasum": "56346d4749d78f23430ca0c713850aef91aa361d",
|
||||
"_spec": "parse-ms@^1.0.0",
|
||||
"_where": "/home/lilleman/go/src/gitlab.larvit.se/power-plan/auth/tests/node_modules/pretty-ms",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "http://sindresorhus.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/sindresorhus/parse-ms/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "Parse milliseconds into an object",
|
||||
"devDependencies": {
|
||||
"mocha": "*"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/sindresorhus/parse-ms#readme",
|
||||
"keywords": [
|
||||
"browser",
|
||||
"parse",
|
||||
"time",
|
||||
"ms",
|
||||
"milliseconds",
|
||||
"duration",
|
||||
"period",
|
||||
"range"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "parse-ms",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sindresorhus/parse-ms.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
},
|
||||
"version": "1.0.1"
|
||||
}
|
||||
23
tests/node_modules/parse-ms/readme.md
generated
vendored
Normal file
23
tests/node_modules/parse-ms/readme.md
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
# parse-ms [](https://travis-ci.org/sindresorhus/parse-ms)
|
||||
|
||||
> Parse milliseconds into an object
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
$ npm install --save parse-ms
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
parseMs(1337000001);
|
||||
//=> { days: 15, hours: 11, minutes: 23, seconds: 20, milliseconds: 1 }
|
||||
```
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](http://sindresorhus.com)
|
||||
Reference in New Issue
Block a user