@sapphire/stopwatch
Advanced tools
Comparing version 1.1.2 to 1.1.3-next.67256ed43b915b02a8b5c68230ba82d6210c5032.0
"use strict"; | ||
var _start, _end; | ||
var _Stopwatch_start, _Stopwatch_end; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -28,3 +28,3 @@ exports.Stopwatch = void 0; | ||
// eslint-disable-next-line @typescript-eslint/explicit-member-accessibility | ||
_start.set(this, void 0); | ||
_Stopwatch_start.set(this, void 0); | ||
/** | ||
@@ -34,6 +34,6 @@ * The end time of this stopwatch | ||
// eslint-disable-next-line @typescript-eslint/explicit-member-accessibility | ||
_end.set(this, void 0); | ||
_Stopwatch_end.set(this, void 0); | ||
this.digits = digits; | ||
tslib_1.__classPrivateFieldSet(this, _start, perf_hooks_1.performance.now()); | ||
tslib_1.__classPrivateFieldSet(this, _end, null); | ||
tslib_1.__classPrivateFieldSet(this, _Stopwatch_start, perf_hooks_1.performance.now(), "f"); | ||
tslib_1.__classPrivateFieldSet(this, _Stopwatch_end, null, "f"); | ||
} | ||
@@ -44,3 +44,3 @@ /** | ||
get duration() { | ||
return tslib_1.__classPrivateFieldGet(this, _end) ? tslib_1.__classPrivateFieldGet(this, _end) - tslib_1.__classPrivateFieldGet(this, _start) : perf_hooks_1.performance.now() - tslib_1.__classPrivateFieldGet(this, _start); | ||
return tslib_1.__classPrivateFieldGet(this, _Stopwatch_end, "f") ? tslib_1.__classPrivateFieldGet(this, _Stopwatch_end, "f") - tslib_1.__classPrivateFieldGet(this, _Stopwatch_start, "f") : perf_hooks_1.performance.now() - tslib_1.__classPrivateFieldGet(this, _Stopwatch_start, "f"); | ||
} | ||
@@ -51,3 +51,3 @@ /** | ||
get running() { | ||
return Boolean(!tslib_1.__classPrivateFieldGet(this, _end)); | ||
return Boolean(!tslib_1.__classPrivateFieldGet(this, _Stopwatch_end, "f")); | ||
} | ||
@@ -58,4 +58,4 @@ /** | ||
restart() { | ||
tslib_1.__classPrivateFieldSet(this, _start, perf_hooks_1.performance.now()); | ||
tslib_1.__classPrivateFieldSet(this, _end, null); | ||
tslib_1.__classPrivateFieldSet(this, _Stopwatch_start, perf_hooks_1.performance.now(), "f"); | ||
tslib_1.__classPrivateFieldSet(this, _Stopwatch_end, null, "f"); | ||
return this; | ||
@@ -67,4 +67,4 @@ } | ||
reset() { | ||
tslib_1.__classPrivateFieldSet(this, _start, perf_hooks_1.performance.now()); | ||
tslib_1.__classPrivateFieldSet(this, _end, tslib_1.__classPrivateFieldGet(this, _start)); | ||
tslib_1.__classPrivateFieldSet(this, _Stopwatch_start, perf_hooks_1.performance.now(), "f"); | ||
tslib_1.__classPrivateFieldSet(this, _Stopwatch_end, tslib_1.__classPrivateFieldGet(this, _Stopwatch_start, "f"), "f"); | ||
return this; | ||
@@ -77,4 +77,4 @@ } | ||
if (!this.running) { | ||
tslib_1.__classPrivateFieldSet(this, _start, perf_hooks_1.performance.now() - this.duration); | ||
tslib_1.__classPrivateFieldSet(this, _end, null); | ||
tslib_1.__classPrivateFieldSet(this, _Stopwatch_start, perf_hooks_1.performance.now() - this.duration, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _Stopwatch_end, null, "f"); | ||
} | ||
@@ -88,3 +88,3 @@ return this; | ||
if (this.running) | ||
tslib_1.__classPrivateFieldSet(this, _end, perf_hooks_1.performance.now()); | ||
tslib_1.__classPrivateFieldSet(this, _Stopwatch_end, perf_hooks_1.performance.now(), "f"); | ||
return this; | ||
@@ -105,3 +105,3 @@ } | ||
exports.Stopwatch = Stopwatch; | ||
_start = new WeakMap(), _end = new WeakMap(); | ||
_Stopwatch_start = new WeakMap(), _Stopwatch_end = new WeakMap(); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@sapphire/stopwatch", | ||
"version": "1.1.2", | ||
"version": "1.1.3-next.67256ed43b915b02a8b5c68230ba82d6210c5032.0", | ||
"description": "Accurately measure passing time.", | ||
@@ -56,3 +56,3 @@ "author": "@sapphire", | ||
}, | ||
"gitHead": "bac0dad29857f40f6e9610af545ba445900af110" | ||
"gitHead": "67256ed43b915b02a8b5c68230ba82d6210c5032" | ||
} |
@@ -39,5 +39,6 @@ <div align="center"> | ||
You can use the following command to install this package, or replace `npm install` with your package manager of choice. | ||
```sh | ||
yarn add @sapphire/stopwatch | ||
# npm install @sapphire/stopwatch | ||
npm install @sapphire/stopwatch | ||
``` | ||
@@ -44,0 +45,0 @@ |
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
19867
144
122
1
1