@valjoux/eta
Advanced tools
Comparing version 0.0.2 to 0.0.4
@@ -5,15 +5,4 @@ 'use strict'; | ||
const NUMERIC = 'numeric'; | ||
/** | ||
* | ||
* @type {Intl.DateTimeFormat} | ||
*/ | ||
var formatTime = require('@valjoux/format-time'); | ||
const tf = new Intl.DateTimeFormat(undefined, { | ||
hour: NUMERIC, | ||
minute: NUMERIC, | ||
second: NUMERIC, | ||
hour12: false | ||
}); | ||
const format = tf.format.bind(tf); | ||
class Eta { | ||
@@ -30,11 +19,11 @@ constructor() { | ||
ini(msg = '') { | ||
return `[${format(this.c)}] [Ini 0ms] ${msg}`; | ||
return `[${formatTime.formatTime(this.c)}] [Ini 0ms] ${msg}`; | ||
} | ||
lap(msg = '') { | ||
return `[${format(this.c)}] [Lap ${this.tick()}ms] ${msg}`; | ||
return `[${formatTime.formatTime(this.c)}] [Lap ${this.tick()}ms] ${msg}`; | ||
} | ||
end(msg = '') { | ||
return `[${format(this.c)}] [End ${this.tick()}ms] ${msg}`; | ||
return `[${formatTime.formatTime(this.c)}] [End ${this.tick()}ms] ${msg}`; | ||
} | ||
@@ -41,0 +30,0 @@ |
@@ -1,14 +0,3 @@ | ||
const NUMERIC = 'numeric'; | ||
/** | ||
* | ||
* @type {Intl.DateTimeFormat} | ||
*/ | ||
import { formatTime } from '@valjoux/format-time'; | ||
const tf = new Intl.DateTimeFormat(undefined, { | ||
hour: NUMERIC, | ||
minute: NUMERIC, | ||
second: NUMERIC, | ||
hour12: false | ||
}); | ||
const format = tf.format.bind(tf); | ||
class Eta { | ||
@@ -25,11 +14,11 @@ constructor() { | ||
ini(msg = '') { | ||
return `[${format(this.c)}] [Ini 0ms] ${msg}`; | ||
return `[${formatTime(this.c)}] [Ini 0ms] ${msg}`; | ||
} | ||
lap(msg = '') { | ||
return `[${format(this.c)}] [Lap ${this.tick()}ms] ${msg}`; | ||
return `[${formatTime(this.c)}] [Lap ${this.tick()}ms] ${msg}`; | ||
} | ||
end(msg = '') { | ||
return `[${format(this.c)}] [End ${this.tick()}ms] ${msg}`; | ||
return `[${formatTime(this.c)}] [End ${this.tick()}ms] ${msg}`; | ||
} | ||
@@ -36,0 +25,0 @@ |
{ | ||
"name": "@valjoux/eta", | ||
"version": "0.0.2", | ||
"version": "0.0.4", | ||
"description": "timer", | ||
@@ -18,3 +18,3 @@ "main": "dist/index.cjs.js", | ||
"dependencies": { | ||
"@valjoux/format-time": "^0.0.2" | ||
"@valjoux/format-time": "^0.0.4" | ||
}, | ||
@@ -36,4 +36,3 @@ "repository": { | ||
}, | ||
"homepage": "https://github.com/hoyeungw/valjoux#readme", | ||
"gitHead": "b6c4d50713975798d4bd2c31eb8914a43bb8f867" | ||
"homepage": "https://github.com/hoyeungw/valjoux#readme" | ||
} |
4350
42
+ Added@valjoux/format-time@0.0.4(transitive)
- Removed@valjoux/format-time@0.0.2(transitive)
Updated@valjoux/format-time@^0.0.4