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