Update prettyMs to 3.2 (#27721)

Missing option keepDecimalsOnWholeSeconds
This commit is contained in:
ocboogie
2018-08-06 11:45:57 -07:00
committed by Sheetal Nandi
parent 82e1fac4d0
commit a08595ef00
2 changed files with 4 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
// Type definitions for pretty-ms 3.0
// Type definitions for pretty-ms 3.2
// Project: https://github.com/sindresorhus/pretty-ms#readme
// Definitions by: BendingBender <https://github.com/BendingBender>
// ocboogie <https://github.com/ocboogie>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export = prettyMs;
@@ -11,6 +12,7 @@ declare namespace prettyMs {
interface PrettyMsOptions {
secDecimalDigits?: number;
msDecimalDigits?: number;
keepDecimalsOnWholeSeconds?: boolean;
compact?: boolean;
verbose?: boolean;
}

View File

@@ -4,6 +4,7 @@ let str: string;
str = prettyMs(133);
str = prettyMs(1337, {compact: true});
str = prettyMs(1335669000, {verbose: true});
str = prettyMs(1335669000, {keepDecimalsOnWholeSeconds: true});
str = prettyMs(1335669000, {secDecimalDigits: 1});
str = prettyMs(1335669000, {msDecimalDigits: 2});
str = prettyMs(new Date(2014, 0, 1, 10, 40).getTime() - new Date(2014, 0, 1, 10, 5).getTime());