@tspro/ts-utils-lib 3.1.0 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/index.d.ts +5 -3
- package/dist/index.es5.iife.js +1 -1
- package/dist/index.es5.polyfilled.iife.js +1 -1
- package/dist/index.js +13 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* TsUtilsLib v3.1.
|
|
2
|
+
* TsUtilsLib v3.1.1 (esm)
|
|
3
3
|
* (c) 2023-2025 PahkaSoft
|
|
4
4
|
* Licensed under the MIT License
|
|
5
5
|
*/
|
|
@@ -4397,14 +4397,19 @@ var _CallTracker = class _CallTracker {
|
|
|
4397
4397
|
constructor() {
|
|
4398
4398
|
__publicField(this, "counts", new UniMap((a, b) => a === b));
|
|
4399
4399
|
}
|
|
4400
|
+
track(value) {
|
|
4401
|
+
const count = this.counts.getOrCreate(value, 0);
|
|
4402
|
+
this.counts.set(value, count + 1);
|
|
4403
|
+
}
|
|
4400
4404
|
getCallCountFor(value) {
|
|
4401
|
-
|
|
4402
|
-
this.counts.set(value, oldCount + 1);
|
|
4403
|
-
return oldCount;
|
|
4405
|
+
return this.counts.get(value) ?? 0;
|
|
4404
4406
|
}
|
|
4405
4407
|
hasBeenCalledWith(value) {
|
|
4406
4408
|
return this.getCallCountFor(value) > 0;
|
|
4407
4409
|
}
|
|
4410
|
+
static track(value) {
|
|
4411
|
+
this._default.track(value);
|
|
4412
|
+
}
|
|
4408
4413
|
static getCallCountFor(value) {
|
|
4409
4414
|
return this._default.getCallCountFor(value);
|
|
4410
4415
|
}
|
|
@@ -4412,13 +4417,15 @@ var _CallTracker = class _CallTracker {
|
|
|
4412
4417
|
return this._default.hasBeenCalledWith(value);
|
|
4413
4418
|
}
|
|
4414
4419
|
};
|
|
4415
|
-
//
|
|
4420
|
+
// ─────────────────────────────────────────
|
|
4421
|
+
// Static default tracker
|
|
4422
|
+
// ─────────────────────────────────────────
|
|
4416
4423
|
__publicField(_CallTracker, "_default", new _CallTracker());
|
|
4417
4424
|
var CallTracker = _CallTracker;
|
|
4418
4425
|
|
|
4419
4426
|
// src/index.ts
|
|
4420
4427
|
function getLibInfo() {
|
|
4421
|
-
return "TsUtilsLib v3.1.
|
|
4428
|
+
return "TsUtilsLib v3.1.1 (esm)";
|
|
4422
4429
|
}
|
|
4423
4430
|
|
|
4424
4431
|
export { AnchoredRect, assert_exports as Assert, BaseContainer, BiMap, CallTracker, cookies_exports as Cookies, DefaultArray, DefaultEqualityFn, device_exports as Device, guard_exports as Guard, IndexArray, LRUCache, LinkedList, MultiContainer, Rect, SignedIndexArray, Stack, TriMap, UniMap, utils_exports as Utils, ValueSet, Vec, asMulti, getLibInfo };
|