@sapphire/stopwatch
Advanced tools
Comparing version 1.5.3-next.848968e9.0 to 1.5.3-next.855b323f
@@ -5,26 +5,12 @@ var SapphireStopwatch = (function (exports) { | ||
var __defProp = Object.defineProperty; | ||
var __typeError = (msg) => { | ||
throw TypeError(msg); | ||
}; | ||
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; | ||
var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); | ||
var __publicField = (obj, key, value) => { | ||
__defNormalProp(obj, key + "" , value); | ||
return value; | ||
}; | ||
var __accessCheck = (obj, member, msg) => { | ||
if (!member.has(obj)) | ||
throw TypeError("Cannot " + msg); | ||
}; | ||
var __privateGet = (obj, member, getter) => { | ||
__accessCheck(obj, member, "read from private field"); | ||
return getter ? getter.call(obj) : member.get(obj); | ||
}; | ||
var __privateAdd = (obj, member, value) => { | ||
if (member.has(obj)) | ||
throw TypeError("Cannot add the same private member more than once"); | ||
member instanceof WeakSet ? member.add(obj) : member.set(obj, value); | ||
}; | ||
var __privateSet = (obj, member, value, setter) => { | ||
__accessCheck(obj, member, "write to private field"); | ||
member.set(obj, value); | ||
return value; | ||
}; | ||
var __publicField = (obj, key, value) => __defNormalProp(obj, key + "" , value); | ||
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); | ||
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)); | ||
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); | ||
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value); | ||
@@ -45,7 +31,7 @@ // src/index.ts | ||
*/ | ||
__privateAdd(this, _start, void 0); | ||
__privateAdd(this, _start); | ||
/** | ||
* The end time of this stopwatch | ||
*/ | ||
__privateAdd(this, _end, void 0); | ||
__privateAdd(this, _end); | ||
this.digits = digits; | ||
@@ -97,4 +83,3 @@ __privateSet(this, _start, performance.now()); | ||
stop() { | ||
if (this.running) | ||
__privateSet(this, _end, performance.now()); | ||
if (this.running) __privateSet(this, _end, performance.now()); | ||
return this; | ||
@@ -107,6 +92,4 @@ } | ||
const time = this.duration; | ||
if (time >= 1e3) | ||
return `${(time / 1e3).toFixed(this.digits)}s`; | ||
if (time >= 1) | ||
return `${time.toFixed(this.digits)}ms`; | ||
if (time >= 1e3) return `${(time / 1e3).toFixed(this.digits)}s`; | ||
if (time >= 1) return `${time.toFixed(this.digits)}ms`; | ||
return `${(time * 1e3).toFixed(this.digits)}\u03BCs`; | ||
@@ -125,3 +108,3 @@ } | ||
})({}); | ||
//# sourceMappingURL=out.js.map | ||
//# sourceMappingURL=index.global.js.map | ||
//# sourceMappingURL=index.global.js.map |
{ | ||
"name": "@sapphire/stopwatch", | ||
"version": "1.5.3-next.848968e9.0", | ||
"version": "1.5.3-next.855b323f", | ||
"description": "Accurately measure passing time.", | ||
@@ -29,3 +29,3 @@ "author": "@sapphire", | ||
"build": "tsup && yarn build:rename-cjs-index", | ||
"build:rename-cjs-index": "tsx --tsconfig ../../scripts/tsconfig.json ../../scripts/rename-cjs-index.cts", | ||
"build:rename-cjs-index": "tsx ../../scripts/rename-cjs-index.cts", | ||
"docs": "typedoc-json-parser", | ||
@@ -37,3 +37,3 @@ "prepack": "yarn build", | ||
"dependencies": { | ||
"tslib": "^2.6.2" | ||
"tslib": "^2.7.0" | ||
}, | ||
@@ -69,13 +69,13 @@ "repository": { | ||
"devDependencies": { | ||
"@favware/cliff-jumper": "^3.0.3", | ||
"@types/jsdom": "^21.1.6", | ||
"@vitest/coverage-v8": "^1.6.0", | ||
"jsdom": "^24.0.0", | ||
"tsup": "^8.0.2", | ||
"tsx": "^4.9.3", | ||
"@favware/cliff-jumper": "^4.1.0", | ||
"@types/jsdom": "^21.1.7", | ||
"@vitest/coverage-v8": "^2.0.5", | ||
"jsdom": "^25.0.0", | ||
"tsup": "^8.2.4", | ||
"tsx": "^4.19.0", | ||
"typedoc": "^0.25.13", | ||
"typedoc-json-parser": "^10.0.0", | ||
"typescript": "^5.4.5", | ||
"vitest": "^1.6.0" | ||
"typescript": "~5.4.5", | ||
"vitest": "^2.0.5" | ||
} | ||
} |
@@ -10,3 +10,2 @@ <div align="center"> | ||
[](https://github.com/sapphiredev/utilities/blob/main/LICENSE.md) | ||
[](https://codecov.io/gh/sapphiredev/utilities) | ||
[](https://bundlephobia.com/result?p=@sapphire/stopwatch) | ||
@@ -13,0 +12,0 @@ [](https://www.npmjs.com/package/@sapphire/stopwatch) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
42657
290
88
Updatedtslib@^2.7.0