@taiga-ui/eslint-plugin-experience-next 0.266.0 → 0.268.0

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.
Files changed (2) hide show
  1. package/index.esm.js +19 -1
  2. package/package.json +5 -5
package/index.esm.js CHANGED
@@ -3447,6 +3447,7 @@ class LRUCache {
3447
3447
  #max;
3448
3448
  #maxSize;
3449
3449
  #dispose;
3450
+ #onInsert;
3450
3451
  #disposeAfter;
3451
3452
  #fetchMethod;
3452
3453
  #memoMethod;
@@ -3528,6 +3529,7 @@ class LRUCache {
3528
3529
  #hasDispose;
3529
3530
  #hasFetchMethod;
3530
3531
  #hasDisposeAfter;
3532
+ #hasOnInsert;
3531
3533
  /**
3532
3534
  * Do not call this method unless you need to inspect the
3533
3535
  * inner workings of the cache. If anything returned by this
@@ -3604,6 +3606,12 @@ class LRUCache {
3604
3606
  get dispose() {
3605
3607
  return this.#dispose;
3606
3608
  }
3609
+ /**
3610
+ * {@link LRUCache.OptionsBase.onInsert} (read-only)
3611
+ */
3612
+ get onInsert() {
3613
+ return this.#onInsert;
3614
+ }
3607
3615
  /**
3608
3616
  * {@link LRUCache.OptionsBase.disposeAfter} (read-only)
3609
3617
  */
@@ -3611,7 +3619,7 @@ class LRUCache {
3611
3619
  return this.#disposeAfter;
3612
3620
  }
3613
3621
  constructor(options) {
3614
- const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort, } = options;
3622
+ const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, onInsert, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort, } = options;
3615
3623
  if (max !== 0 && !isPosInt(max)) {
3616
3624
  throw new TypeError('max option must be a nonnegative integer');
3617
3625
  }
@@ -3655,6 +3663,9 @@ class LRUCache {
3655
3663
  if (typeof dispose === 'function') {
3656
3664
  this.#dispose = dispose;
3657
3665
  }
3666
+ if (typeof onInsert === 'function') {
3667
+ this.#onInsert = onInsert;
3668
+ }
3658
3669
  if (typeof disposeAfter === 'function') {
3659
3670
  this.#disposeAfter = disposeAfter;
3660
3671
  this.#disposed = [];
@@ -3664,6 +3675,7 @@ class LRUCache {
3664
3675
  this.#disposed = undefined;
3665
3676
  }
3666
3677
  this.#hasDispose = !!this.#dispose;
3678
+ this.#hasOnInsert = !!this.#onInsert;
3667
3679
  this.#hasDisposeAfter = !!this.#disposeAfter;
3668
3680
  this.noDisposeOnSet = !!noDisposeOnSet;
3669
3681
  this.noUpdateTTL = !!noUpdateTTL;
@@ -4231,6 +4243,9 @@ class LRUCache {
4231
4243
  if (status)
4232
4244
  status.set = 'add';
4233
4245
  noUpdateTTL = false;
4246
+ if (this.#hasOnInsert) {
4247
+ this.#onInsert?.(v, k, 'add');
4248
+ }
4234
4249
  }
4235
4250
  else {
4236
4251
  // update
@@ -4272,6 +4287,9 @@ class LRUCache {
4272
4287
  else if (status) {
4273
4288
  status.set = 'update';
4274
4289
  }
4290
+ if (this.#hasOnInsert) {
4291
+ this.onInsert?.(v, k, v === oldVal ? 'update' : 'replace');
4292
+ }
4275
4293
  }
4276
4294
  if (ttl !== 0 && !this.#ttls) {
4277
4295
  this.#initializeTTLTracking();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taiga-ui/eslint-plugin-experience-next",
3
- "version": "0.266.0",
3
+ "version": "0.268.0",
4
4
  "description": "An ESLint plugin to enforce a consistent code styles across taiga-ui projects",
5
5
  "license": "Apache-2.0",
6
6
  "main": "index.ts",
@@ -9,7 +9,7 @@
9
9
  "@smarttools/eslint-plugin-rxjs": ">=1.0.18",
10
10
  "@stylistic/eslint-plugin": ">=4.2.0",
11
11
  "@stylistic/eslint-plugin-ts": ">=4.2.0",
12
- "@typescript-eslint/eslint-plugin": ">=8.27.0",
12
+ "@typescript-eslint/eslint-plugin": ">=8.28.0",
13
13
  "angular-eslint": ">=19.3.0",
14
14
  "eslint": ">=9.23.0",
15
15
  "eslint-config-prettier": ">=10.1.1",
@@ -20,14 +20,14 @@
20
20
  "eslint-plugin-jest": ">=28.11.0",
21
21
  "eslint-plugin-perfectionist": ">=4.10.1",
22
22
  "eslint-plugin-playwright": ">=2.2.0",
23
- "eslint-plugin-prettier": ">=5.2.3",
23
+ "eslint-plugin-prettier": ">=5.2.5",
24
24
  "eslint-plugin-promise": ">=7.2.1",
25
25
  "eslint-plugin-simple-import-sort": ">=12.1.1",
26
26
  "eslint-plugin-sonarjs": ">=3.0.2",
27
- "eslint-plugin-unicorn": ">=57.0.0",
27
+ "eslint-plugin-unicorn": ">=58.0.0",
28
28
  "eslint-plugin-unused-imports": ">=4.1.4",
29
29
  "globals": ">=16.0.0",
30
- "typescript-eslint": ">=8.27.0"
30
+ "typescript-eslint": ">=8.28.0"
31
31
  },
32
32
  "publishConfig": {
33
33
  "access": "public"