-
-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Require Node.js 12 and move to ESM (#56)
- Loading branch information
Showing
8 changed files
with
150 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
import {expectType} from 'tsd'; | ||
import prettyMilliseconds = require('.'); | ||
import prettyMilliseconds from './index.js'; | ||
|
||
expectType<string>(prettyMilliseconds(1335669000)); | ||
expectType<string>(prettyMilliseconds(1335669000, {secondsDecimalDigits: 1})); | ||
expectType<string>(prettyMilliseconds(1_335_669_000)); | ||
expectType<string>(prettyMilliseconds(1_335_669_000, {secondsDecimalDigits: 1})); | ||
expectType<string>( | ||
prettyMilliseconds(1335669000, {millisecondsDecimalDigits: 2}) | ||
prettyMilliseconds(1_335_669_000, {millisecondsDecimalDigits: 2}), | ||
); | ||
expectType<string>( | ||
prettyMilliseconds(1335669000, {keepDecimalsOnWholeSeconds: true}) | ||
prettyMilliseconds(1_335_669_000, {keepDecimalsOnWholeSeconds: true}), | ||
); | ||
expectType<string>(prettyMilliseconds(1337, {compact: true})); | ||
expectType<string>(prettyMilliseconds(1335669000, {unitCount: 2})); | ||
expectType<string>(prettyMilliseconds(1335669000, {verbose: true})); | ||
expectType<string>(prettyMilliseconds(1_335_669_000, {unitCount: 2})); | ||
expectType<string>(prettyMilliseconds(1_335_669_000, {verbose: true})); | ||
expectType<string>( | ||
prettyMilliseconds(1335669000, {separateMilliseconds: true}) | ||
prettyMilliseconds(1_335_669_000, {separateMilliseconds: true}), | ||
); | ||
expectType<string>( | ||
prettyMilliseconds(1335669000, {formatSubMilliseconds: true}) | ||
prettyMilliseconds(1_335_669_000, {formatSubMilliseconds: true}), | ||
); | ||
expectType<string>( | ||
prettyMilliseconds(1335669000, {colonNotation: true}) | ||
prettyMilliseconds(1_335_669_000, {colonNotation: true}), | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
MIT License | ||
|
||
Copyright (c) Sindre Sorhus <[email protected]> (sindresorhus.com) | ||
Copyright (c) Sindre Sorhus <[email protected]> (https://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: | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,8 +10,10 @@ | |
"email": "[email protected]", | ||
"url": "https://sindresorhus.com" | ||
}, | ||
"type": "module", | ||
"exports": "./index.js", | ||
"engines": { | ||
"node": ">=10" | ||
"node": ">=12" | ||
}, | ||
"scripts": { | ||
"test": "xo && ava && tsd" | ||
|
@@ -39,11 +41,11 @@ | |
"hrtime" | ||
], | ||
"dependencies": { | ||
"parse-ms": "^2.1.0" | ||
"parse-ms": "^3.0.0" | ||
}, | ||
"devDependencies": { | ||
"ava": "^2.4.0", | ||
"tsd": "^0.11.0", | ||
"xo": "^0.30.0" | ||
"ava": "^3.15.0", | ||
"tsd": "^0.19.0", | ||
"xo": "^0.47.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.