replace jest with ava
This commit is contained in:
parent
27cc8b23fe
commit
0347b72305
11775 changed files with 84546 additions and 1440575 deletions
33
node_modules/date-time/index.js
generated
vendored
Normal file
33
node_modules/date-time/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
'use strict';
|
||||
const timeZone = require('time-zone');
|
||||
|
||||
module.exports = options => {
|
||||
options = Object.assign({
|
||||
date: new Date(),
|
||||
local: true,
|
||||
showTimeZone: false,
|
||||
showMilliseconds: false
|
||||
}, options);
|
||||
|
||||
let date = options.date;
|
||||
|
||||
if (options.local) {
|
||||
// Offset the date so it will return the correct value when getting the ISO string
|
||||
date = new Date(date.getTime() - (date.getTimezoneOffset() * 60000));
|
||||
}
|
||||
|
||||
let end = '';
|
||||
|
||||
if (options.showTimeZone) {
|
||||
end = ' UTC' + (options.local ? timeZone(date) : '');
|
||||
}
|
||||
|
||||
if (options.showMilliseconds && date.getUTCMilliseconds() > 0) {
|
||||
end = ` ${date.getUTCMilliseconds()}ms${end}`;
|
||||
}
|
||||
|
||||
return date
|
||||
.toISOString()
|
||||
.replace(/T/, ' ')
|
||||
.replace(/\..+/, end);
|
||||
};
|
||||
21
node_modules/date-time/license
generated
vendored
Normal file
21
node_modules/date-time/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.
|
||||
39
node_modules/date-time/package.json
generated
vendored
Normal file
39
node_modules/date-time/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
{
|
||||
"name": "date-time",
|
||||
"version": "2.1.0",
|
||||
"description": "Pretty datetime: `2014-01-09 06:46:01`",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/date-time",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"keywords": [
|
||||
"datetime",
|
||||
"date-time",
|
||||
"date",
|
||||
"time",
|
||||
"utc",
|
||||
"iso",
|
||||
"timezone",
|
||||
"zone",
|
||||
"timestamp"
|
||||
],
|
||||
"dependencies": {
|
||||
"time-zone": "^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"xo": "*"
|
||||
}
|
||||
}
|
||||
77
node_modules/date-time/readme.md
generated
vendored
Normal file
77
node_modules/date-time/readme.md
generated
vendored
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
# date-time [](https://travis-ci.org/sindresorhus/date-time)
|
||||
|
||||
> Pretty datetime: `2014-01-09 06:46:01`
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save date-time
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const dateTime = require('date-time');
|
||||
|
||||
dateTime();
|
||||
//=> '2017-05-20 17:07:05'
|
||||
|
||||
dateTime({date: new Date(1989, 2, 4, 10)});
|
||||
//=> '1989-03-04 09:00:00'
|
||||
|
||||
dateTime({showTimeZone: true});
|
||||
//=> '2017-05-20 17:07:05 UTC+7'
|
||||
|
||||
dateTime({local: false});
|
||||
//=> '2017-05-20 10:07:05'
|
||||
|
||||
dateTime({local: false, showTimeZone: true});
|
||||
//=> '2017-05-20 10:07:05 UTC'
|
||||
|
||||
dateTime({showMilliseconds: true});
|
||||
//=> '2017-05-20 17:07:05 6ms'
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### dateTime([options])
|
||||
|
||||
### options
|
||||
|
||||
Type: `Object`
|
||||
|
||||
#### date
|
||||
|
||||
Type: `Date`<br>
|
||||
Default: `new Date()`
|
||||
|
||||
Custom date.
|
||||
|
||||
#### local
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `true`
|
||||
|
||||
Show the date in the local time zone.
|
||||
|
||||
#### showTimeZone
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `false`
|
||||
|
||||
Show the UTC time zone postfix.
|
||||
|
||||
#### showMilliseconds
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `false`
|
||||
|
||||
Show the milliseconds in the date if any.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
Loading…
Add table
Add a link
Reference in a new issue