This commit is contained in:
Erik 2022-07-29 16:42:27 +03:00
parent 7245651cda
commit 2c5af27763
Signed by: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB
4 changed files with 6181 additions and 8 deletions

View File

@ -1,5 +1,13 @@
# Changelog
## 6.0.2
- TS typings
## 6.0.1
- Added `mo` as a shorthand for month
## 6.0.0
- Drop support for Node.js `< 8.0.0`

6154
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,7 @@
{
"types:": "timestring.d.ts",
"name": "@navy.gif/timestring",
"version": "6.0.1",
"version": "6.0.2",
"description": "Parse a human readable time string into a time based value",
"main": "index.js",
"scripts": {
@ -31,6 +32,7 @@
"devDependencies": {
"chai": "^4.2.0",
"coveralls": "^3.0.6",
"dts-gen": "^0.6.0",
"istanbul": "^0.4.5",
"mocha": "^7.0.1",
"mocha-lcov-reporter": "1.3.0",

23
timestring.d.ts vendored Normal file
View File

@ -0,0 +1,23 @@
/** Declaration file generated by dts-gen */
export = timestring;
type ReturnUnit =
'ms' |
's' |
'm' |
'h' |
'd' |
'w' |
'th' |
'y'
type TimestringOptions = {
hoursPerDay: number
daysPerWeek: number
weeksPerMonth: number
monthsPerYear: number
daysPerYear: number
}
declare function timestring(string: string, returnUnit: ReturnUnit, opts: TimestringOptions): any;