@eslint-react/shared 1.45.2 → 1.45.3-next.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.
package/dist/index.js CHANGED
@@ -4,7 +4,9 @@ var module$1 = require('module');
4
4
  var eff = require('@eslint-react/eff');
5
5
  var tsPattern = require('ts-pattern');
6
6
  var z = require('@zod/mini');
7
- var pm = require('picomatch');
7
+ var kit = require('@eslint-react/kit');
8
+ var fastEquals = require('fast-equals');
9
+ var memoize = require('micro-memoize');
8
10
 
9
11
  var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
10
12
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
@@ -29,7 +31,7 @@ function _interopNamespace(e) {
29
31
 
30
32
  var module__default = /*#__PURE__*/_interopDefault(module$1);
31
33
  var z__namespace = /*#__PURE__*/_interopNamespace(z);
32
- var pm__default = /*#__PURE__*/_interopDefault(pm);
34
+ var memoize__default = /*#__PURE__*/_interopDefault(memoize);
33
35
 
34
36
  // src/constants.ts
35
37
  var NPM_SCOPE = "@eslint-react";
@@ -207,710 +209,16 @@ var DEFAULT_ESLINT_REACT_SETTINGS = {
207
209
  useLayoutEffect: ["useIsomorphicLayoutEffect"]
208
210
  }
209
211
  };
210
-
211
- // ../../node_modules/.pnpm/fast-equals@5.2.2/node_modules/fast-equals/dist/esm/index.mjs
212
- var getOwnPropertyNames = Object.getOwnPropertyNames;
213
- var getOwnPropertySymbols = Object.getOwnPropertySymbols;
214
- var hasOwnProperty = Object.prototype.hasOwnProperty;
215
- function combineComparators(comparatorA, comparatorB) {
216
- return function isEqual(a, b, state) {
217
- return comparatorA(a, b, state) && comparatorB(a, b, state);
218
- };
219
- }
220
- function createIsCircular(areItemsEqual) {
221
- return function isCircular(a, b, state) {
222
- if (!a || !b || typeof a !== "object" || typeof b !== "object") {
223
- return areItemsEqual(a, b, state);
224
- }
225
- var cache = state.cache;
226
- var cachedA = cache.get(a);
227
- var cachedB = cache.get(b);
228
- if (cachedA && cachedB) {
229
- return cachedA === b && cachedB === a;
230
- }
231
- cache.set(a, b);
232
- cache.set(b, a);
233
- var result = areItemsEqual(a, b, state);
234
- cache.delete(a);
235
- cache.delete(b);
236
- return result;
237
- };
238
- }
239
- function getStrictProperties(object2) {
240
- return getOwnPropertyNames(object2).concat(getOwnPropertySymbols(object2));
241
- }
242
- var hasOwn = Object.hasOwn || function(object2, property) {
243
- return hasOwnProperty.call(object2, property);
244
- };
245
- function sameValueZeroEqual(a, b) {
246
- return a === b || !a && !b && a !== a && b !== b;
247
- }
248
- var PREACT_VNODE = "__v";
249
- var PREACT_OWNER = "__o";
250
- var REACT_OWNER = "_owner";
251
- var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
252
- var keys = Object.keys;
253
- function areArraysEqual(a, b, state) {
254
- var index = a.length;
255
- if (b.length !== index) {
256
- return false;
257
- }
258
- while (index-- > 0) {
259
- if (!state.equals(a[index], b[index], index, index, a, b, state)) {
260
- return false;
261
- }
262
- }
263
- return true;
264
- }
265
- function areDatesEqual(a, b) {
266
- return sameValueZeroEqual(a.getTime(), b.getTime());
267
- }
268
- function areErrorsEqual(a, b) {
269
- return a.name === b.name && a.message === b.message && a.cause === b.cause && a.stack === b.stack;
270
- }
271
- function areFunctionsEqual(a, b) {
272
- return a === b;
273
- }
274
- function areMapsEqual(a, b, state) {
275
- var size = a.size;
276
- if (size !== b.size) {
277
- return false;
278
- }
279
- if (!size) {
280
- return true;
281
- }
282
- var matchedIndices = new Array(size);
283
- var aIterable = a.entries();
284
- var aResult;
285
- var bResult;
286
- var index = 0;
287
- while (aResult = aIterable.next()) {
288
- if (aResult.done) {
289
- break;
290
- }
291
- var bIterable = b.entries();
292
- var hasMatch = false;
293
- var matchIndex = 0;
294
- while (bResult = bIterable.next()) {
295
- if (bResult.done) {
296
- break;
297
- }
298
- if (matchedIndices[matchIndex]) {
299
- matchIndex++;
300
- continue;
301
- }
302
- var aEntry = aResult.value;
303
- var bEntry = bResult.value;
304
- if (state.equals(aEntry[0], bEntry[0], index, matchIndex, a, b, state) && state.equals(aEntry[1], bEntry[1], aEntry[0], bEntry[0], a, b, state)) {
305
- hasMatch = matchedIndices[matchIndex] = true;
306
- break;
307
- }
308
- matchIndex++;
309
- }
310
- if (!hasMatch) {
311
- return false;
312
- }
313
- index++;
314
- }
315
- return true;
316
- }
317
- var areNumbersEqual = sameValueZeroEqual;
318
- function areObjectsEqual(a, b, state) {
319
- var properties = keys(a);
320
- var index = properties.length;
321
- if (keys(b).length !== index) {
322
- return false;
323
- }
324
- while (index-- > 0) {
325
- if (!isPropertyEqual(a, b, state, properties[index])) {
326
- return false;
327
- }
328
- }
329
- return true;
330
- }
331
- function areObjectsEqualStrict(a, b, state) {
332
- var properties = getStrictProperties(a);
333
- var index = properties.length;
334
- if (getStrictProperties(b).length !== index) {
335
- return false;
336
- }
337
- var property;
338
- var descriptorA;
339
- var descriptorB;
340
- while (index-- > 0) {
341
- property = properties[index];
342
- if (!isPropertyEqual(a, b, state, property)) {
343
- return false;
344
- }
345
- descriptorA = getOwnPropertyDescriptor(a, property);
346
- descriptorB = getOwnPropertyDescriptor(b, property);
347
- if ((descriptorA || descriptorB) && (!descriptorA || !descriptorB || descriptorA.configurable !== descriptorB.configurable || descriptorA.enumerable !== descriptorB.enumerable || descriptorA.writable !== descriptorB.writable)) {
348
- return false;
349
- }
350
- }
351
- return true;
352
- }
353
- function arePrimitiveWrappersEqual(a, b) {
354
- return sameValueZeroEqual(a.valueOf(), b.valueOf());
355
- }
356
- function areRegExpsEqual(a, b) {
357
- return a.source === b.source && a.flags === b.flags;
358
- }
359
- function areSetsEqual(a, b, state) {
360
- var size = a.size;
361
- if (size !== b.size) {
362
- return false;
363
- }
364
- if (!size) {
365
- return true;
366
- }
367
- var matchedIndices = new Array(size);
368
- var aIterable = a.values();
369
- var aResult;
370
- var bResult;
371
- while (aResult = aIterable.next()) {
372
- if (aResult.done) {
373
- break;
374
- }
375
- var bIterable = b.values();
376
- var hasMatch = false;
377
- var matchIndex = 0;
378
- while (bResult = bIterable.next()) {
379
- if (bResult.done) {
380
- break;
381
- }
382
- if (!matchedIndices[matchIndex] && state.equals(aResult.value, bResult.value, aResult.value, bResult.value, a, b, state)) {
383
- hasMatch = matchedIndices[matchIndex] = true;
384
- break;
385
- }
386
- matchIndex++;
387
- }
388
- if (!hasMatch) {
389
- return false;
390
- }
391
- }
392
- return true;
393
- }
394
- function areTypedArraysEqual(a, b) {
395
- var index = a.length;
396
- if (b.length !== index) {
397
- return false;
398
- }
399
- while (index-- > 0) {
400
- if (a[index] !== b[index]) {
401
- return false;
402
- }
403
- }
404
- return true;
405
- }
406
- function areUrlsEqual(a, b) {
407
- return a.hostname === b.hostname && a.pathname === b.pathname && a.protocol === b.protocol && a.port === b.port && a.hash === b.hash && a.username === b.username && a.password === b.password;
408
- }
409
- function isPropertyEqual(a, b, state, property) {
410
- if ((property === REACT_OWNER || property === PREACT_OWNER || property === PREACT_VNODE) && (a.$$typeof || b.$$typeof)) {
411
- return true;
412
- }
413
- return hasOwn(b, property) && state.equals(a[property], b[property], property, property, a, b, state);
414
- }
415
- var ARGUMENTS_TAG = "[object Arguments]";
416
- var BOOLEAN_TAG = "[object Boolean]";
417
- var DATE_TAG = "[object Date]";
418
- var ERROR_TAG = "[object Error]";
419
- var MAP_TAG = "[object Map]";
420
- var NUMBER_TAG = "[object Number]";
421
- var OBJECT_TAG = "[object Object]";
422
- var REG_EXP_TAG = "[object RegExp]";
423
- var SET_TAG = "[object Set]";
424
- var STRING_TAG = "[object String]";
425
- var URL_TAG = "[object URL]";
426
- var isArray = Array.isArray;
427
- var isTypedArray = typeof ArrayBuffer === "function" && ArrayBuffer.isView ? ArrayBuffer.isView : null;
428
- var assign = Object.assign;
429
- var getTag = Object.prototype.toString.call.bind(Object.prototype.toString);
430
- function createEqualityComparator(_a) {
431
- var areArraysEqual2 = _a.areArraysEqual, areDatesEqual2 = _a.areDatesEqual, areErrorsEqual2 = _a.areErrorsEqual, areFunctionsEqual2 = _a.areFunctionsEqual, areMapsEqual2 = _a.areMapsEqual, areNumbersEqual2 = _a.areNumbersEqual, areObjectsEqual2 = _a.areObjectsEqual, arePrimitiveWrappersEqual2 = _a.arePrimitiveWrappersEqual, areRegExpsEqual2 = _a.areRegExpsEqual, areSetsEqual2 = _a.areSetsEqual, areTypedArraysEqual2 = _a.areTypedArraysEqual, areUrlsEqual2 = _a.areUrlsEqual;
432
- return function comparator(a, b, state) {
433
- if (a === b) {
434
- return true;
435
- }
436
- if (a == null || b == null) {
437
- return false;
438
- }
439
- var type = typeof a;
440
- if (type !== typeof b) {
441
- return false;
442
- }
443
- if (type !== "object") {
444
- if (type === "number") {
445
- return areNumbersEqual2(a, b, state);
446
- }
447
- if (type === "function") {
448
- return areFunctionsEqual2(a, b, state);
449
- }
450
- return false;
451
- }
452
- var constructor = a.constructor;
453
- if (constructor !== b.constructor) {
454
- return false;
455
- }
456
- if (constructor === Object) {
457
- return areObjectsEqual2(a, b, state);
458
- }
459
- if (isArray(a)) {
460
- return areArraysEqual2(a, b, state);
461
- }
462
- if (isTypedArray != null && isTypedArray(a)) {
463
- return areTypedArraysEqual2(a, b, state);
464
- }
465
- if (constructor === Date) {
466
- return areDatesEqual2(a, b, state);
467
- }
468
- if (constructor === RegExp) {
469
- return areRegExpsEqual2(a, b, state);
470
- }
471
- if (constructor === Map) {
472
- return areMapsEqual2(a, b, state);
473
- }
474
- if (constructor === Set) {
475
- return areSetsEqual2(a, b, state);
476
- }
477
- var tag = getTag(a);
478
- if (tag === DATE_TAG) {
479
- return areDatesEqual2(a, b, state);
480
- }
481
- if (tag === REG_EXP_TAG) {
482
- return areRegExpsEqual2(a, b, state);
483
- }
484
- if (tag === MAP_TAG) {
485
- return areMapsEqual2(a, b, state);
486
- }
487
- if (tag === SET_TAG) {
488
- return areSetsEqual2(a, b, state);
489
- }
490
- if (tag === OBJECT_TAG) {
491
- return typeof a.then !== "function" && typeof b.then !== "function" && areObjectsEqual2(a, b, state);
492
- }
493
- if (tag === URL_TAG) {
494
- return areUrlsEqual2(a, b, state);
495
- }
496
- if (tag === ERROR_TAG) {
497
- return areErrorsEqual2(a, b, state);
498
- }
499
- if (tag === ARGUMENTS_TAG) {
500
- return areObjectsEqual2(a, b, state);
501
- }
502
- if (tag === BOOLEAN_TAG || tag === NUMBER_TAG || tag === STRING_TAG) {
503
- return arePrimitiveWrappersEqual2(a, b, state);
504
- }
505
- return false;
506
- };
507
- }
508
- function createEqualityComparatorConfig(_a) {
509
- var circular = _a.circular, createCustomConfig = _a.createCustomConfig, strict = _a.strict;
510
- var config = {
511
- areArraysEqual: strict ? areObjectsEqualStrict : areArraysEqual,
512
- areDatesEqual,
513
- areErrorsEqual,
514
- areFunctionsEqual,
515
- areMapsEqual: strict ? combineComparators(areMapsEqual, areObjectsEqualStrict) : areMapsEqual,
516
- areNumbersEqual,
517
- areObjectsEqual: strict ? areObjectsEqualStrict : areObjectsEqual,
518
- arePrimitiveWrappersEqual,
519
- areRegExpsEqual,
520
- areSetsEqual: strict ? combineComparators(areSetsEqual, areObjectsEqualStrict) : areSetsEqual,
521
- areTypedArraysEqual: strict ? areObjectsEqualStrict : areTypedArraysEqual,
522
- areUrlsEqual
523
- };
524
- if (createCustomConfig) {
525
- config = assign({}, config, createCustomConfig(config));
526
- }
527
- if (circular) {
528
- var areArraysEqual$1 = createIsCircular(config.areArraysEqual);
529
- var areMapsEqual$1 = createIsCircular(config.areMapsEqual);
530
- var areObjectsEqual$1 = createIsCircular(config.areObjectsEqual);
531
- var areSetsEqual$1 = createIsCircular(config.areSetsEqual);
532
- config = assign({}, config, {
533
- areArraysEqual: areArraysEqual$1,
534
- areMapsEqual: areMapsEqual$1,
535
- areObjectsEqual: areObjectsEqual$1,
536
- areSetsEqual: areSetsEqual$1
537
- });
538
- }
539
- return config;
540
- }
541
- function createInternalEqualityComparator(compare) {
542
- return function(a, b, _indexOrKeyA, _indexOrKeyB, _parentA, _parentB, state) {
543
- return compare(a, b, state);
544
- };
545
- }
546
- function createIsEqual(_a) {
547
- var circular = _a.circular, comparator = _a.comparator, createState = _a.createState, equals = _a.equals, strict = _a.strict;
548
- if (createState) {
549
- return function isEqual(a, b) {
550
- var _a2 = createState(), _b = _a2.cache, cache = _b === void 0 ? circular ? /* @__PURE__ */ new WeakMap() : void 0 : _b, meta = _a2.meta;
551
- return comparator(a, b, {
552
- cache,
553
- equals,
554
- meta,
555
- strict
556
- });
557
- };
558
- }
559
- if (circular) {
560
- return function isEqual(a, b) {
561
- return comparator(a, b, {
562
- cache: /* @__PURE__ */ new WeakMap(),
563
- equals,
564
- meta: void 0,
565
- strict
566
- });
567
- };
568
- }
569
- var state = {
570
- cache: void 0,
571
- equals,
572
- meta: void 0,
573
- strict
574
- };
575
- return function isEqual(a, b) {
576
- return comparator(a, b, state);
577
- };
578
- }
579
- createCustomEqual();
580
- createCustomEqual({ strict: true });
581
- createCustomEqual({ circular: true });
582
- createCustomEqual({
583
- circular: true,
584
- strict: true
585
- });
586
- var shallowEqual = createCustomEqual({
587
- createInternalComparator: function() {
588
- return sameValueZeroEqual;
589
- }
590
- });
591
- createCustomEqual({
592
- strict: true,
593
- createInternalComparator: function() {
594
- return sameValueZeroEqual;
595
- }
596
- });
597
- createCustomEqual({
598
- circular: true,
599
- createInternalComparator: function() {
600
- return sameValueZeroEqual;
601
- }
602
- });
603
- createCustomEqual({
604
- circular: true,
605
- createInternalComparator: function() {
606
- return sameValueZeroEqual;
607
- },
608
- strict: true
609
- });
610
- function createCustomEqual(options) {
611
- if (options === void 0) {
612
- options = {};
613
- }
614
- var _a = options.circular, circular = _a === void 0 ? false : _a, createCustomInternalComparator = options.createInternalComparator, createState = options.createState, _b = options.strict, strict = _b === void 0 ? false : _b;
615
- var config = createEqualityComparatorConfig(options);
616
- var comparator = createEqualityComparator(config);
617
- var equals = createCustomInternalComparator ? createCustomInternalComparator(comparator) : createInternalEqualityComparator(comparator);
618
- return createIsEqual({ circular, comparator, createState, equals, strict });
619
- }
620
-
621
- // ../../node_modules/.pnpm/micro-memoize@4.1.3/node_modules/micro-memoize/dist/micro-memoize.esm.js
622
- var DEFAULT_OPTIONS_KEYS = {
623
- isEqual: true,
624
- isMatchingKey: true,
625
- isPromise: true,
626
- maxSize: true,
627
- onCacheAdd: true,
628
- onCacheChange: true,
629
- onCacheHit: true,
630
- transformKey: true
631
- };
632
- var slice = Array.prototype.slice;
633
- function cloneArray(arrayLike) {
634
- var length = arrayLike.length;
635
- if (!length) {
636
- return [];
637
- }
638
- if (length === 1) {
639
- return [arrayLike[0]];
640
- }
641
- if (length === 2) {
642
- return [arrayLike[0], arrayLike[1]];
643
- }
644
- if (length === 3) {
645
- return [arrayLike[0], arrayLike[1], arrayLike[2]];
646
- }
647
- return slice.call(arrayLike, 0);
648
- }
649
- function getCustomOptions(options) {
650
- var customOptions = {};
651
- for (var key in options) {
652
- if (!DEFAULT_OPTIONS_KEYS[key]) {
653
- customOptions[key] = options[key];
654
- }
655
- }
656
- return customOptions;
657
- }
658
- function isMemoized(fn) {
659
- return typeof fn === "function" && fn.isMemoized;
660
- }
661
- function isSameValueZero(object1, object2) {
662
- return object1 === object2 || object1 !== object1 && object2 !== object2;
663
- }
664
- function mergeOptions(existingOptions, newOptions) {
665
- var target = {};
666
- for (var key in existingOptions) {
667
- target[key] = existingOptions[key];
668
- }
669
- for (var key in newOptions) {
670
- target[key] = newOptions[key];
671
- }
672
- return target;
673
- }
674
- var Cache = (
675
- /** @class */
676
- function() {
677
- function Cache2(options) {
678
- this.keys = [];
679
- this.values = [];
680
- this.options = options;
681
- var isMatchingKeyFunction = typeof options.isMatchingKey === "function";
682
- if (isMatchingKeyFunction) {
683
- this.getKeyIndex = this._getKeyIndexFromMatchingKey;
684
- } else if (options.maxSize > 1) {
685
- this.getKeyIndex = this._getKeyIndexForMany;
686
- } else {
687
- this.getKeyIndex = this._getKeyIndexForSingle;
688
- }
689
- this.canTransformKey = typeof options.transformKey === "function";
690
- this.shouldCloneArguments = this.canTransformKey || isMatchingKeyFunction;
691
- this.shouldUpdateOnAdd = typeof options.onCacheAdd === "function";
692
- this.shouldUpdateOnChange = typeof options.onCacheChange === "function";
693
- this.shouldUpdateOnHit = typeof options.onCacheHit === "function";
694
- }
695
- Object.defineProperty(Cache2.prototype, "size", {
696
- /**
697
- * The number of cached [key,value] results.
698
- */
699
- get: function() {
700
- return this.keys.length;
701
- },
702
- enumerable: false,
703
- configurable: true
704
- });
705
- Object.defineProperty(Cache2.prototype, "snapshot", {
706
- /**
707
- * A copy of the cache at a moment in time. This is useful
708
- * to compare changes over time, since the cache mutates
709
- * internally for performance reasons.
710
- */
711
- get: function() {
712
- return {
713
- keys: cloneArray(this.keys),
714
- size: this.size,
715
- values: cloneArray(this.values)
716
- };
717
- },
718
- enumerable: false,
719
- configurable: true
720
- });
721
- Cache2.prototype._getKeyIndexFromMatchingKey = function(keyToMatch) {
722
- var _a = this.options, isMatchingKey = _a.isMatchingKey, maxSize = _a.maxSize;
723
- var keys2 = this.keys;
724
- var keysLength = keys2.length;
725
- if (!keysLength) {
726
- return -1;
727
- }
728
- if (isMatchingKey(keys2[0], keyToMatch)) {
729
- return 0;
730
- }
731
- if (maxSize > 1) {
732
- for (var index = 1; index < keysLength; index++) {
733
- if (isMatchingKey(keys2[index], keyToMatch)) {
734
- return index;
735
- }
736
- }
737
- }
738
- return -1;
739
- };
740
- Cache2.prototype._getKeyIndexForMany = function(keyToMatch) {
741
- var isEqual = this.options.isEqual;
742
- var keys2 = this.keys;
743
- var keysLength = keys2.length;
744
- if (!keysLength) {
745
- return -1;
746
- }
747
- if (keysLength === 1) {
748
- return this._getKeyIndexForSingle(keyToMatch);
749
- }
750
- var keyLength = keyToMatch.length;
751
- var existingKey;
752
- var argIndex;
753
- if (keyLength > 1) {
754
- for (var index = 0; index < keysLength; index++) {
755
- existingKey = keys2[index];
756
- if (existingKey.length === keyLength) {
757
- argIndex = 0;
758
- for (; argIndex < keyLength; argIndex++) {
759
- if (!isEqual(existingKey[argIndex], keyToMatch[argIndex])) {
760
- break;
761
- }
762
- }
763
- if (argIndex === keyLength) {
764
- return index;
765
- }
766
- }
767
- }
768
- } else {
769
- for (var index = 0; index < keysLength; index++) {
770
- existingKey = keys2[index];
771
- if (existingKey.length === keyLength && isEqual(existingKey[0], keyToMatch[0])) {
772
- return index;
773
- }
774
- }
775
- }
776
- return -1;
777
- };
778
- Cache2.prototype._getKeyIndexForSingle = function(keyToMatch) {
779
- var keys2 = this.keys;
780
- if (!keys2.length) {
781
- return -1;
782
- }
783
- var existingKey = keys2[0];
784
- var length = existingKey.length;
785
- if (keyToMatch.length !== length) {
786
- return -1;
787
- }
788
- var isEqual = this.options.isEqual;
789
- if (length > 1) {
790
- for (var index = 0; index < length; index++) {
791
- if (!isEqual(existingKey[index], keyToMatch[index])) {
792
- return -1;
793
- }
794
- }
795
- return 0;
796
- }
797
- return isEqual(existingKey[0], keyToMatch[0]) ? 0 : -1;
798
- };
799
- Cache2.prototype.orderByLru = function(key, value, startingIndex) {
800
- var keys2 = this.keys;
801
- var values = this.values;
802
- var currentLength = keys2.length;
803
- var index = startingIndex;
804
- while (index--) {
805
- keys2[index + 1] = keys2[index];
806
- values[index + 1] = values[index];
807
- }
808
- keys2[0] = key;
809
- values[0] = value;
810
- var maxSize = this.options.maxSize;
811
- if (currentLength === maxSize && startingIndex === currentLength) {
812
- keys2.pop();
813
- values.pop();
814
- } else if (startingIndex >= maxSize) {
815
- keys2.length = values.length = maxSize;
816
- }
817
- };
818
- Cache2.prototype.updateAsyncCache = function(memoized) {
819
- var _this = this;
820
- var _a = this.options, onCacheChange = _a.onCacheChange, onCacheHit = _a.onCacheHit;
821
- var firstKey = this.keys[0];
822
- var firstValue = this.values[0];
823
- this.values[0] = firstValue.then(function(value) {
824
- if (_this.shouldUpdateOnHit) {
825
- onCacheHit(_this, _this.options, memoized);
826
- }
827
- if (_this.shouldUpdateOnChange) {
828
- onCacheChange(_this, _this.options, memoized);
829
- }
830
- return value;
831
- }, function(error) {
832
- var keyIndex = _this.getKeyIndex(firstKey);
833
- if (keyIndex !== -1) {
834
- _this.keys.splice(keyIndex, 1);
835
- _this.values.splice(keyIndex, 1);
836
- }
837
- throw error;
838
- });
839
- };
840
- return Cache2;
841
- }()
842
- );
843
- function createMemoizedFunction(fn, options) {
844
- if (options === void 0) {
845
- options = {};
846
- }
847
- if (isMemoized(fn)) {
848
- return createMemoizedFunction(fn.fn, mergeOptions(fn.options, options));
849
- }
850
- if (typeof fn !== "function") {
851
- throw new TypeError("You must pass a function to `memoize`.");
852
- }
853
- var _a = options.isEqual, isEqual = _a === void 0 ? isSameValueZero : _a, isMatchingKey = options.isMatchingKey, _b = options.isPromise, isPromise = _b === void 0 ? false : _b, _c = options.maxSize, maxSize = _c === void 0 ? 1 : _c, onCacheAdd = options.onCacheAdd, onCacheChange = options.onCacheChange, onCacheHit = options.onCacheHit, transformKey = options.transformKey;
854
- var normalizedOptions = mergeOptions({
855
- isEqual,
856
- isMatchingKey,
857
- isPromise,
858
- maxSize,
859
- onCacheAdd,
860
- onCacheChange,
861
- onCacheHit,
862
- transformKey
863
- }, getCustomOptions(options));
864
- var cache = new Cache(normalizedOptions);
865
- var keys2 = cache.keys, values = cache.values, canTransformKey = cache.canTransformKey, shouldCloneArguments = cache.shouldCloneArguments, shouldUpdateOnAdd = cache.shouldUpdateOnAdd, shouldUpdateOnChange = cache.shouldUpdateOnChange, shouldUpdateOnHit = cache.shouldUpdateOnHit;
866
- var memoized = function() {
867
- var key = shouldCloneArguments ? cloneArray(arguments) : arguments;
868
- if (canTransformKey) {
869
- key = transformKey(key);
870
- }
871
- var keyIndex = keys2.length ? cache.getKeyIndex(key) : -1;
872
- if (keyIndex !== -1) {
873
- if (shouldUpdateOnHit) {
874
- onCacheHit(cache, normalizedOptions, memoized);
875
- }
876
- if (keyIndex) {
877
- cache.orderByLru(keys2[keyIndex], values[keyIndex], keyIndex);
878
- if (shouldUpdateOnChange) {
879
- onCacheChange(cache, normalizedOptions, memoized);
880
- }
881
- }
882
- } else {
883
- var newValue = fn.apply(this, arguments);
884
- var newKey = shouldCloneArguments ? key : cloneArray(arguments);
885
- cache.orderByLru(newKey, newValue, keys2.length);
886
- if (isPromise) {
887
- cache.updateAsyncCache(memoized);
888
- }
889
- if (shouldUpdateOnAdd) {
890
- onCacheAdd(cache, normalizedOptions, memoized);
891
- }
892
- if (shouldUpdateOnChange) {
893
- onCacheChange(cache, normalizedOptions, memoized);
894
- }
895
- }
896
- return values[0];
897
- };
898
- memoized.cache = cache;
899
- memoized.fn = fn;
900
- memoized.isMemoized = true;
901
- memoized.options = normalizedOptions;
902
- return memoized;
903
- }
904
212
  function unsafeDecodeSettings(data) {
905
213
  return data?.["react-x"] ?? {};
906
214
  }
907
- var decodeSettings = createMemoizedFunction((data) => {
215
+ var decodeSettings = memoize__default.default((data) => {
908
216
  return {
909
217
  ...DEFAULT_ESLINT_REACT_SETTINGS,
910
218
  ...z__namespace.parse(ESLintSettingsSchema, data)?.["react-x"] ?? {}
911
219
  };
912
220
  }, { isEqual: (a, b) => a === b });
913
- var toNormalizedSettings = createMemoizedFunction(
221
+ var toNormalizedSettings = memoize__default.default(
914
222
  ({
915
223
  additionalComponents = [],
916
224
  additionalHooks = {},
@@ -937,7 +245,7 @@ var toNormalizedSettings = createMemoizedFunction(
937
245
  name: name2,
938
246
  as: as2
939
247
  })),
940
- re: pm__default.default.makeRe(name, { fastpaths: true })
248
+ re: kit.RE.toRegExp(name)
941
249
  })),
942
250
  additionalHooks,
943
251
  importSource,
@@ -946,7 +254,7 @@ var toNormalizedSettings = createMemoizedFunction(
946
254
  version: tsPattern.match(version).with(tsPattern.P.union(tsPattern.P.nullish, "", "detect"), () => getReactVersion("19.1.0")).otherwise(eff.identity)
947
255
  };
948
256
  },
949
- { isEqual: shallowEqual }
257
+ { isEqual: fastEquals.shallowEqual }
950
258
  );
951
259
  function getSettingsFromContext(context) {
952
260
  return toNormalizedSettings(decodeSettings(context.settings));