@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.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
/*!
|
|
4
|
-
* TsUtilsLib v3.1.
|
|
4
|
+
* TsUtilsLib v3.1.1 (cjs)
|
|
5
5
|
* (c) 2023-2025 PahkaSoft
|
|
6
6
|
* Licensed under the MIT License
|
|
7
7
|
*/
|
|
@@ -4399,14 +4399,19 @@ var _CallTracker = class _CallTracker {
|
|
|
4399
4399
|
constructor() {
|
|
4400
4400
|
__publicField(this, "counts", new UniMap((a, b) => a === b));
|
|
4401
4401
|
}
|
|
4402
|
+
track(value) {
|
|
4403
|
+
const count = this.counts.getOrCreate(value, 0);
|
|
4404
|
+
this.counts.set(value, count + 1);
|
|
4405
|
+
}
|
|
4402
4406
|
getCallCountFor(value) {
|
|
4403
|
-
|
|
4404
|
-
this.counts.set(value, oldCount + 1);
|
|
4405
|
-
return oldCount;
|
|
4407
|
+
return this.counts.get(value) ?? 0;
|
|
4406
4408
|
}
|
|
4407
4409
|
hasBeenCalledWith(value) {
|
|
4408
4410
|
return this.getCallCountFor(value) > 0;
|
|
4409
4411
|
}
|
|
4412
|
+
static track(value) {
|
|
4413
|
+
this._default.track(value);
|
|
4414
|
+
}
|
|
4410
4415
|
static getCallCountFor(value) {
|
|
4411
4416
|
return this._default.getCallCountFor(value);
|
|
4412
4417
|
}
|
|
@@ -4414,13 +4419,15 @@ var _CallTracker = class _CallTracker {
|
|
|
4414
4419
|
return this._default.hasBeenCalledWith(value);
|
|
4415
4420
|
}
|
|
4416
4421
|
};
|
|
4417
|
-
//
|
|
4422
|
+
// ─────────────────────────────────────────
|
|
4423
|
+
// Static default tracker
|
|
4424
|
+
// ─────────────────────────────────────────
|
|
4418
4425
|
__publicField(_CallTracker, "_default", new _CallTracker());
|
|
4419
4426
|
var CallTracker = _CallTracker;
|
|
4420
4427
|
|
|
4421
4428
|
// src/index.ts
|
|
4422
4429
|
function getLibInfo() {
|
|
4423
|
-
return "TsUtilsLib v3.1.
|
|
4430
|
+
return "TsUtilsLib v3.1.1 (cjs)";
|
|
4424
4431
|
}
|
|
4425
4432
|
|
|
4426
4433
|
exports.AnchoredRect = AnchoredRect;
|