@eslint-react/jsx 1.5.11-beta.1 → 1.5.11-beta.13
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.d.mts +4 -76
- package/dist/index.d.ts +4 -76
- package/dist/index.js +967 -355
- package/dist/index.mjs +968 -333
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -1,23 +1,46 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var types = require('@typescript-eslint/types');
|
|
3
4
|
var ast = require('@eslint-react/ast');
|
|
4
|
-
var shared = require('@eslint-react/shared');
|
|
5
|
-
var memo = require('micro-memoize');
|
|
6
5
|
var _var = require('@eslint-react/var');
|
|
7
|
-
var types = require('@typescript-eslint/types');
|
|
8
6
|
require('@typescript-eslint/utils');
|
|
9
7
|
|
|
10
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
-
|
|
12
|
-
var memo__default = /*#__PURE__*/_interopDefault(memo);
|
|
13
|
-
|
|
14
8
|
var __defProp = Object.defineProperty;
|
|
15
9
|
var __export = (target, all3) => {
|
|
16
10
|
for (var name in all3)
|
|
17
11
|
__defProp(target, name, { get: all3[name], enumerable: true });
|
|
18
12
|
};
|
|
13
|
+
function resolveMemberExpressions(object, property) {
|
|
14
|
+
if (object.type === types.AST_NODE_TYPES.JSXMemberExpression) {
|
|
15
|
+
return `${resolveMemberExpressions(object.object, object.property)}.${property.name}`;
|
|
16
|
+
}
|
|
17
|
+
if (object.type === types.AST_NODE_TYPES.JSXNamespacedName) {
|
|
18
|
+
return `${object.namespace.name}:${object.name.name}.${property.name}`;
|
|
19
|
+
}
|
|
20
|
+
return `${object.name}.${property.name}`;
|
|
21
|
+
}
|
|
22
|
+
function elementType(node) {
|
|
23
|
+
if (node.type === types.AST_NODE_TYPES.JSXOpeningFragment) {
|
|
24
|
+
return "<>";
|
|
25
|
+
}
|
|
26
|
+
const { name } = node;
|
|
27
|
+
if (name.type === types.AST_NODE_TYPES.JSXMemberExpression) {
|
|
28
|
+
const { object, property } = name;
|
|
29
|
+
return resolveMemberExpressions(object, property);
|
|
30
|
+
}
|
|
31
|
+
if (name.type === types.AST_NODE_TYPES.JSXNamespacedName) {
|
|
32
|
+
return `${name.namespace.name}:${name.name.name}`;
|
|
33
|
+
}
|
|
34
|
+
return name.name;
|
|
35
|
+
}
|
|
36
|
+
function isJSXElementOfUserDefinedComponent(node) {
|
|
37
|
+
return node.openingElement.name.type === ast.NodeType.JSXIdentifier && /^[A-Z]/u.test(node.openingElement.name.name);
|
|
38
|
+
}
|
|
39
|
+
function isJSXElementOfBuiltinComponent(node) {
|
|
40
|
+
return node.openingElement.name.type === ast.NodeType.JSXIdentifier && node.openingElement.name.name.toLowerCase() === node.openingElement.name.name && /^[a-z]/u.test(node.openingElement.name.name);
|
|
41
|
+
}
|
|
19
42
|
|
|
20
|
-
// ../../../node_modules/.pnpm/effect@3.
|
|
43
|
+
// ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Function.js
|
|
21
44
|
var Function_exports = {};
|
|
22
45
|
__export(Function_exports, {
|
|
23
46
|
SK: () => SK,
|
|
@@ -192,14 +215,164 @@ function flow(ab, bc, cd, de, ef, fg, gh, hi, ij) {
|
|
|
192
215
|
var hole = /* @__PURE__ */ unsafeCoerce(absurd);
|
|
193
216
|
var SK = (_2, b2) => b2;
|
|
194
217
|
|
|
195
|
-
// ../../../node_modules/.pnpm/effect@3.
|
|
218
|
+
// ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Array.js
|
|
219
|
+
var Array_exports = {};
|
|
220
|
+
__export(Array_exports, {
|
|
221
|
+
allocate: () => allocate,
|
|
222
|
+
append: () => append,
|
|
223
|
+
appendAll: () => appendAll,
|
|
224
|
+
cartesian: () => cartesian,
|
|
225
|
+
cartesianWith: () => cartesianWith,
|
|
226
|
+
chop: () => chop,
|
|
227
|
+
chunksOf: () => chunksOf,
|
|
228
|
+
contains: () => contains2,
|
|
229
|
+
containsWith: () => containsWith2,
|
|
230
|
+
copy: () => copy,
|
|
231
|
+
dedupe: () => dedupe,
|
|
232
|
+
dedupeAdjacent: () => dedupeAdjacent,
|
|
233
|
+
dedupeAdjacentWith: () => dedupeAdjacentWith,
|
|
234
|
+
dedupeWith: () => dedupeWith,
|
|
235
|
+
difference: () => difference,
|
|
236
|
+
differenceWith: () => differenceWith,
|
|
237
|
+
drop: () => drop,
|
|
238
|
+
dropRight: () => dropRight,
|
|
239
|
+
dropWhile: () => dropWhile,
|
|
240
|
+
empty: () => empty2,
|
|
241
|
+
every: () => every2,
|
|
242
|
+
extend: () => extend,
|
|
243
|
+
filter: () => filter2,
|
|
244
|
+
filterMap: () => filterMap2,
|
|
245
|
+
filterMapWhile: () => filterMapWhile,
|
|
246
|
+
findFirst: () => findFirst2,
|
|
247
|
+
findFirstIndex: () => findFirstIndex,
|
|
248
|
+
findLast: () => findLast,
|
|
249
|
+
findLastIndex: () => findLastIndex,
|
|
250
|
+
flatMap: () => flatMap2,
|
|
251
|
+
flatMapNullable: () => flatMapNullable2,
|
|
252
|
+
flatten: () => flatten2,
|
|
253
|
+
forEach: () => forEach,
|
|
254
|
+
fromIterable: () => fromIterable2,
|
|
255
|
+
fromNullable: () => fromNullable2,
|
|
256
|
+
fromOption: () => fromOption2,
|
|
257
|
+
fromRecord: () => fromRecord,
|
|
258
|
+
get: () => get,
|
|
259
|
+
getEquivalence: () => getEquivalence2,
|
|
260
|
+
getLefts: () => getLefts,
|
|
261
|
+
getOrder: () => getOrder2,
|
|
262
|
+
getRights: () => getRights,
|
|
263
|
+
getSomes: () => getSomes,
|
|
264
|
+
group: () => group,
|
|
265
|
+
groupBy: () => groupBy,
|
|
266
|
+
groupWith: () => groupWith,
|
|
267
|
+
head: () => head,
|
|
268
|
+
headNonEmpty: () => headNonEmpty,
|
|
269
|
+
init: () => init,
|
|
270
|
+
initNonEmpty: () => initNonEmpty,
|
|
271
|
+
insertAt: () => insertAt,
|
|
272
|
+
intersection: () => intersection,
|
|
273
|
+
intersectionWith: () => intersectionWith,
|
|
274
|
+
intersperse: () => intersperse,
|
|
275
|
+
isArray: () => isArray,
|
|
276
|
+
isEmptyArray: () => isEmptyArray,
|
|
277
|
+
isEmptyReadonlyArray: () => isEmptyReadonlyArray,
|
|
278
|
+
isNonEmptyArray: () => isNonEmptyArray2,
|
|
279
|
+
isNonEmptyReadonlyArray: () => isNonEmptyReadonlyArray,
|
|
280
|
+
join: () => join,
|
|
281
|
+
last: () => last,
|
|
282
|
+
lastNonEmpty: () => lastNonEmpty,
|
|
283
|
+
length: () => length,
|
|
284
|
+
liftEither: () => liftEither,
|
|
285
|
+
liftNullable: () => liftNullable2,
|
|
286
|
+
liftOption: () => liftOption,
|
|
287
|
+
liftPredicate: () => liftPredicate2,
|
|
288
|
+
make: () => make4,
|
|
289
|
+
makeBy: () => makeBy,
|
|
290
|
+
map: () => map2,
|
|
291
|
+
mapAccum: () => mapAccum,
|
|
292
|
+
match: () => match2,
|
|
293
|
+
matchLeft: () => matchLeft,
|
|
294
|
+
matchRight: () => matchRight,
|
|
295
|
+
max: () => max2,
|
|
296
|
+
min: () => min2,
|
|
297
|
+
modify: () => modify,
|
|
298
|
+
modifyNonEmptyHead: () => modifyNonEmptyHead,
|
|
299
|
+
modifyNonEmptyLast: () => modifyNonEmptyLast,
|
|
300
|
+
modifyOption: () => modifyOption,
|
|
301
|
+
of: () => of,
|
|
302
|
+
partition: () => partition,
|
|
303
|
+
partitionMap: () => partitionMap2,
|
|
304
|
+
prepend: () => prepend,
|
|
305
|
+
prependAll: () => prependAll,
|
|
306
|
+
range: () => range,
|
|
307
|
+
reduce: () => reduce,
|
|
308
|
+
reduceRight: () => reduceRight,
|
|
309
|
+
remove: () => remove,
|
|
310
|
+
replace: () => replace,
|
|
311
|
+
replaceOption: () => replaceOption,
|
|
312
|
+
replicate: () => replicate,
|
|
313
|
+
reverse: () => reverse,
|
|
314
|
+
rotate: () => rotate,
|
|
315
|
+
scan: () => scan,
|
|
316
|
+
scanRight: () => scanRight,
|
|
317
|
+
separate: () => separate,
|
|
318
|
+
setNonEmptyHead: () => setNonEmptyHead,
|
|
319
|
+
setNonEmptyLast: () => setNonEmptyLast,
|
|
320
|
+
some: () => some4,
|
|
321
|
+
sort: () => sort,
|
|
322
|
+
sortBy: () => sortBy,
|
|
323
|
+
sortWith: () => sortWith,
|
|
324
|
+
span: () => span,
|
|
325
|
+
split: () => split,
|
|
326
|
+
splitAt: () => splitAt,
|
|
327
|
+
splitNonEmptyAt: () => splitNonEmptyAt,
|
|
328
|
+
splitWhere: () => splitWhere,
|
|
329
|
+
tail: () => tail,
|
|
330
|
+
tailNonEmpty: () => tailNonEmpty,
|
|
331
|
+
take: () => take,
|
|
332
|
+
takeRight: () => takeRight,
|
|
333
|
+
takeWhile: () => takeWhile,
|
|
334
|
+
unappend: () => unappend,
|
|
335
|
+
unfold: () => unfold,
|
|
336
|
+
union: () => union,
|
|
337
|
+
unionWith: () => unionWith,
|
|
338
|
+
unprepend: () => unprepend,
|
|
339
|
+
unsafeGet: () => unsafeGet,
|
|
340
|
+
unzip: () => unzip,
|
|
341
|
+
zip: () => zip,
|
|
342
|
+
zipWith: () => zipWith2
|
|
343
|
+
});
|
|
344
|
+
|
|
345
|
+
// ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Equivalence.js
|
|
196
346
|
var make = (isEquivalent) => (self, that) => self === that || isEquivalent(self, that);
|
|
347
|
+
var array = (item) => make((self, that) => {
|
|
348
|
+
if (self.length !== that.length) {
|
|
349
|
+
return false;
|
|
350
|
+
}
|
|
351
|
+
for (let i2 = 0; i2 < self.length; i2++) {
|
|
352
|
+
const isEq = item(self[i2], that[i2]);
|
|
353
|
+
if (!isEq) {
|
|
354
|
+
return false;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
return true;
|
|
358
|
+
});
|
|
197
359
|
|
|
198
|
-
// ../../../node_modules/.pnpm/effect@3.
|
|
199
|
-
var
|
|
360
|
+
// ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/internal/doNotation.js
|
|
361
|
+
var let_ = (map3) => dual(3, (self, name, f2) => map3(self, (a2) => Object.assign({}, a2, {
|
|
362
|
+
[name]: f2(a2)
|
|
363
|
+
})));
|
|
364
|
+
var bindTo = (map3) => dual(2, (self, name) => map3(self, (a2) => ({
|
|
365
|
+
[name]: a2
|
|
366
|
+
})));
|
|
367
|
+
var bind = (map3, flatMap3) => dual(3, (self, name, f2) => flatMap3(self, (a2) => map3(f2(a2), (b2) => Object.assign({}, a2, {
|
|
368
|
+
[name]: b2
|
|
369
|
+
}))));
|
|
370
|
+
|
|
371
|
+
// ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/internal/version.js
|
|
372
|
+
var moduleVersion = "3.1.2";
|
|
200
373
|
var getCurrentVersion = () => moduleVersion;
|
|
201
374
|
|
|
202
|
-
// ../../../node_modules/.pnpm/effect@3.
|
|
375
|
+
// ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/GlobalValue.js
|
|
203
376
|
var globalStoreId = /* @__PURE__ */ Symbol.for(`effect/GlobalValue/globalStoreId/${/* @__PURE__ */ getCurrentVersion()}`);
|
|
204
377
|
if (!(globalStoreId in globalThis)) {
|
|
205
378
|
globalThis[globalStoreId] = /* @__PURE__ */ new Map();
|
|
@@ -212,7 +385,7 @@ var globalValue = (id, compute) => {
|
|
|
212
385
|
return globalStore.get(id);
|
|
213
386
|
};
|
|
214
387
|
|
|
215
|
-
// ../../../node_modules/.pnpm/effect@3.
|
|
388
|
+
// ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Predicate.js
|
|
216
389
|
var Predicate_exports = {};
|
|
217
390
|
__export(Predicate_exports, {
|
|
218
391
|
all: () => all,
|
|
@@ -310,13 +483,13 @@ var all = (collection) => {
|
|
|
310
483
|
};
|
|
311
484
|
var productMany = (self, collection) => {
|
|
312
485
|
const rest = all(collection);
|
|
313
|
-
return ([
|
|
486
|
+
return ([head2, ...tail2]) => self(head2) === false ? false : rest(tail2);
|
|
314
487
|
};
|
|
315
488
|
var tuple = (...elements) => all(elements);
|
|
316
489
|
var struct = (fields) => {
|
|
317
|
-
const
|
|
490
|
+
const keys2 = Object.keys(fields);
|
|
318
491
|
return (a2) => {
|
|
319
|
-
for (const key of
|
|
492
|
+
for (const key of keys2) {
|
|
320
493
|
if (!fields[key](a2[key])) {
|
|
321
494
|
return false;
|
|
322
495
|
}
|
|
@@ -349,10 +522,10 @@ var some = (collection) => (a2) => {
|
|
|
349
522
|
return false;
|
|
350
523
|
};
|
|
351
524
|
|
|
352
|
-
// ../../../node_modules/.pnpm/effect@3.
|
|
525
|
+
// ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/internal/errors.js
|
|
353
526
|
var getBugErrorMessage = (message) => `BUG: ${message} - please report an issue at https://github.com/Effect-TS/effect/issues`;
|
|
354
527
|
|
|
355
|
-
// ../../../node_modules/.pnpm/effect@3.
|
|
528
|
+
// ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Utils.js
|
|
356
529
|
var GenKindTypeId = /* @__PURE__ */ Symbol.for("effect/Gen/GenKind");
|
|
357
530
|
var isGenKind = (u2) => isObject(u2) && GenKindTypeId in u2;
|
|
358
531
|
var GenKindImpl = class {
|
|
@@ -498,19 +671,19 @@ var PCGRandom = class {
|
|
|
498
671
|
* @category getter
|
|
499
672
|
* @since 2.0.0
|
|
500
673
|
*/
|
|
501
|
-
integer(
|
|
502
|
-
if (!
|
|
674
|
+
integer(max3) {
|
|
675
|
+
if (!max3) {
|
|
503
676
|
return this._next();
|
|
504
677
|
}
|
|
505
|
-
|
|
506
|
-
if ((
|
|
507
|
-
return this._next() &
|
|
678
|
+
max3 = max3 >>> 0;
|
|
679
|
+
if ((max3 & max3 - 1) === 0) {
|
|
680
|
+
return this._next() & max3 - 1;
|
|
508
681
|
}
|
|
509
682
|
let num = 0;
|
|
510
|
-
const skew = (-
|
|
683
|
+
const skew = (-max3 >>> 0) % max3 >>> 0;
|
|
511
684
|
for (num = this._next(); num < skew; num = this._next()) {
|
|
512
685
|
}
|
|
513
|
-
return num %
|
|
686
|
+
return num % max3;
|
|
514
687
|
}
|
|
515
688
|
/**
|
|
516
689
|
* Get a uniformly distributed IEEE-754 double between 0.0 and 1.0, with
|
|
@@ -591,8 +764,12 @@ function yieldWrapGet(self) {
|
|
|
591
764
|
}
|
|
592
765
|
throw new Error(getBugErrorMessage("yieldWrapGet"));
|
|
593
766
|
}
|
|
767
|
+
var structuralRegionState = /* @__PURE__ */ globalValue("effect/Utils/isStructuralRegion", () => ({
|
|
768
|
+
enabled: false,
|
|
769
|
+
tester: void 0
|
|
770
|
+
}));
|
|
594
771
|
|
|
595
|
-
// ../../../node_modules/.pnpm/effect@3.
|
|
772
|
+
// ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Hash.js
|
|
596
773
|
var randomHashCache = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("effect/Hash/randomHashCache"), () => /* @__PURE__ */ new WeakMap());
|
|
597
774
|
var pcgr = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("effect/Hash/pcgr"), () => new PCGRandom());
|
|
598
775
|
var symbol = /* @__PURE__ */ Symbol.for("effect/Hash");
|
|
@@ -626,6 +803,9 @@ var hash = (self) => {
|
|
|
626
803
|
}
|
|
627
804
|
};
|
|
628
805
|
var random = (self) => {
|
|
806
|
+
if (structuralRegionState.enabled === true) {
|
|
807
|
+
return 0;
|
|
808
|
+
}
|
|
629
809
|
if (!randomHashCache.has(self)) {
|
|
630
810
|
randomHashCache.set(self, number(pcgr.integer(Number.MAX_SAFE_INTEGER)));
|
|
631
811
|
}
|
|
@@ -658,27 +838,39 @@ var cached = function() {
|
|
|
658
838
|
if (arguments.length === 1) {
|
|
659
839
|
const self2 = arguments[0];
|
|
660
840
|
return function(hash3) {
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
841
|
+
const original2 = self2[symbol].bind(self2);
|
|
842
|
+
if (structuralRegionState.enabled === false) {
|
|
843
|
+
Object.defineProperty(self2, symbol, {
|
|
844
|
+
value() {
|
|
845
|
+
if (structuralRegionState.enabled === true) {
|
|
846
|
+
return original2();
|
|
847
|
+
}
|
|
848
|
+
return hash3;
|
|
849
|
+
},
|
|
850
|
+
enumerable: false
|
|
851
|
+
});
|
|
852
|
+
}
|
|
667
853
|
return hash3;
|
|
668
854
|
};
|
|
669
855
|
}
|
|
670
856
|
const self = arguments[0];
|
|
671
857
|
const hash2 = arguments[1];
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
858
|
+
const original = self[symbol].bind(self);
|
|
859
|
+
if (structuralRegionState.enabled === false) {
|
|
860
|
+
Object.defineProperty(self, symbol, {
|
|
861
|
+
value() {
|
|
862
|
+
if (structuralRegionState.enabled === true) {
|
|
863
|
+
return original();
|
|
864
|
+
}
|
|
865
|
+
return hash2;
|
|
866
|
+
},
|
|
867
|
+
enumerable: false
|
|
868
|
+
});
|
|
869
|
+
}
|
|
678
870
|
return hash2;
|
|
679
871
|
};
|
|
680
872
|
|
|
681
|
-
// ../../../node_modules/.pnpm/effect@3.
|
|
873
|
+
// ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Equal.js
|
|
682
874
|
var symbol2 = /* @__PURE__ */ Symbol.for("effect/Equal");
|
|
683
875
|
function equals() {
|
|
684
876
|
if (arguments.length === 1) {
|
|
@@ -694,17 +886,37 @@ function compareBoth(self, that) {
|
|
|
694
886
|
if (selfType !== typeof that) {
|
|
695
887
|
return false;
|
|
696
888
|
}
|
|
697
|
-
if (
|
|
698
|
-
if (
|
|
699
|
-
|
|
889
|
+
if (selfType === "object" || selfType === "function") {
|
|
890
|
+
if (self !== null && that !== null) {
|
|
891
|
+
if (isEqual(self) && isEqual(that)) {
|
|
892
|
+
return hash(self) === hash(that) && self[symbol2](that);
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
if (structuralRegionState.enabled) {
|
|
896
|
+
if (Array.isArray(self) && Array.isArray(that)) {
|
|
897
|
+
return self.length === that.length && self.every((v2, i2) => compareBoth(v2, that[i2]));
|
|
898
|
+
}
|
|
899
|
+
if (Object.getPrototypeOf(self) === Object.prototype && Object.getPrototypeOf(self) === Object.prototype) {
|
|
900
|
+
const keysSelf = Object.keys(self);
|
|
901
|
+
const keysThat = Object.keys(that);
|
|
902
|
+
if (keysSelf.length === keysThat.length) {
|
|
903
|
+
for (const key of keysSelf) {
|
|
904
|
+
if (!(key in that && compareBoth(self[key], that[key]))) {
|
|
905
|
+
return structuralRegionState.tester ? structuralRegionState.tester(self, that) : false;
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
return true;
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
return structuralRegionState.tester ? structuralRegionState.tester(self, that) : false;
|
|
700
912
|
}
|
|
701
913
|
}
|
|
702
|
-
return false;
|
|
914
|
+
return structuralRegionState.enabled && structuralRegionState.tester ? structuralRegionState.tester(self, that) : false;
|
|
703
915
|
}
|
|
704
916
|
var isEqual = (u2) => hasProperty(u2, symbol2);
|
|
705
917
|
var equivalence = () => equals;
|
|
706
918
|
|
|
707
|
-
// ../../../node_modules/.pnpm/effect@3.
|
|
919
|
+
// ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Inspectable.js
|
|
708
920
|
var NodeInspectSymbol = /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom");
|
|
709
921
|
var toJSON = (x2) => {
|
|
710
922
|
if (hasProperty(x2, "toJSON") && isFunction2(x2["toJSON"]) && x2["toJSON"].length === 0) {
|
|
@@ -716,7 +928,7 @@ var toJSON = (x2) => {
|
|
|
716
928
|
};
|
|
717
929
|
var format = (x2) => JSON.stringify(x2, null, 2);
|
|
718
930
|
|
|
719
|
-
// ../../../node_modules/.pnpm/effect@3.
|
|
931
|
+
// ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Pipeable.js
|
|
720
932
|
var pipeArguments = (self, args) => {
|
|
721
933
|
switch (args.length) {
|
|
722
934
|
case 1:
|
|
@@ -747,7 +959,7 @@ var pipeArguments = (self, args) => {
|
|
|
747
959
|
}
|
|
748
960
|
};
|
|
749
961
|
|
|
750
|
-
// ../../../node_modules/.pnpm/effect@3.
|
|
962
|
+
// ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/internal/effectable.js
|
|
751
963
|
var EffectTypeId = /* @__PURE__ */ Symbol.for("effect/Effect");
|
|
752
964
|
var StreamTypeId = /* @__PURE__ */ Symbol.for("effect/Stream");
|
|
753
965
|
var SinkTypeId = /* @__PURE__ */ Symbol.for("effect/Sink");
|
|
@@ -808,7 +1020,7 @@ var EffectPrototype = {
|
|
|
808
1020
|
}
|
|
809
1021
|
};
|
|
810
1022
|
|
|
811
|
-
// ../../../node_modules/.pnpm/effect@3.
|
|
1023
|
+
// ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/internal/option.js
|
|
812
1024
|
var TypeId = /* @__PURE__ */ Symbol.for("effect/Option");
|
|
813
1025
|
var CommonProto = {
|
|
814
1026
|
...EffectPrototype,
|
|
@@ -866,7 +1078,7 @@ var some2 = (value) => {
|
|
|
866
1078
|
return a2;
|
|
867
1079
|
};
|
|
868
1080
|
|
|
869
|
-
// ../../../node_modules/.pnpm/effect@3.
|
|
1081
|
+
// ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/internal/either.js
|
|
870
1082
|
var TypeId2 = /* @__PURE__ */ Symbol.for("effect/Either");
|
|
871
1083
|
var CommonProto2 = {
|
|
872
1084
|
...EffectPrototype,
|
|
@@ -930,7 +1142,14 @@ var right = (right2) => {
|
|
|
930
1142
|
var getLeft = (self) => isRight(self) ? none : some2(self.left);
|
|
931
1143
|
var getRight = (self) => isLeft(self) ? none : some2(self.right);
|
|
932
1144
|
|
|
933
|
-
// ../../../node_modules/.pnpm/effect@3.
|
|
1145
|
+
// ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Either.js
|
|
1146
|
+
var isLeft2 = isLeft;
|
|
1147
|
+
var isRight2 = isRight;
|
|
1148
|
+
|
|
1149
|
+
// ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/internal/array.js
|
|
1150
|
+
var isNonEmptyArray = (self) => self.length > 0;
|
|
1151
|
+
|
|
1152
|
+
// ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Option.js
|
|
934
1153
|
var Option_exports = {};
|
|
935
1154
|
__export(Option_exports, {
|
|
936
1155
|
Do: () => Do,
|
|
@@ -940,8 +1159,8 @@ __export(Option_exports, {
|
|
|
940
1159
|
ap: () => ap,
|
|
941
1160
|
as: () => as,
|
|
942
1161
|
asVoid: () => asVoid,
|
|
943
|
-
bind: () =>
|
|
944
|
-
bindTo: () =>
|
|
1162
|
+
bind: () => bind2,
|
|
1163
|
+
bindTo: () => bindTo2,
|
|
945
1164
|
composeK: () => composeK,
|
|
946
1165
|
contains: () => contains,
|
|
947
1166
|
containsWith: () => containsWith,
|
|
@@ -967,7 +1186,7 @@ __export(Option_exports, {
|
|
|
967
1186
|
isNone: () => isNone2,
|
|
968
1187
|
isOption: () => isOption2,
|
|
969
1188
|
isSome: () => isSome2,
|
|
970
|
-
let: () =>
|
|
1189
|
+
let: () => let_2,
|
|
971
1190
|
lift2: () => lift2,
|
|
972
1191
|
liftNullable: () => liftNullable,
|
|
973
1192
|
liftPredicate: () => liftPredicate,
|
|
@@ -992,10 +1211,41 @@ __export(Option_exports, {
|
|
|
992
1211
|
zipWith: () => zipWith
|
|
993
1212
|
});
|
|
994
1213
|
|
|
995
|
-
// ../../../node_modules/.pnpm/effect@3.
|
|
1214
|
+
// ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Order.js
|
|
996
1215
|
var make2 = (compare) => (self, that) => self === that ? 0 : compare(self, that);
|
|
1216
|
+
var number2 = /* @__PURE__ */ make2((self, that) => self < that ? -1 : 1);
|
|
1217
|
+
var combineMany = /* @__PURE__ */ dual(2, (self, collection) => make2((a1, a2) => {
|
|
1218
|
+
let out = self(a1, a2);
|
|
1219
|
+
if (out !== 0) {
|
|
1220
|
+
return out;
|
|
1221
|
+
}
|
|
1222
|
+
for (const O2 of collection) {
|
|
1223
|
+
out = O2(a1, a2);
|
|
1224
|
+
if (out !== 0) {
|
|
1225
|
+
return out;
|
|
1226
|
+
}
|
|
1227
|
+
}
|
|
1228
|
+
return out;
|
|
1229
|
+
}));
|
|
1230
|
+
var empty = () => make2(() => 0);
|
|
1231
|
+
var combineAll = (collection) => combineMany(empty(), collection);
|
|
1232
|
+
var mapInput2 = /* @__PURE__ */ dual(2, (self, f2) => make2((b1, b2) => self(f2(b1), f2(b2))));
|
|
1233
|
+
var array2 = (O2) => make2((self, that) => {
|
|
1234
|
+
const aLen = self.length;
|
|
1235
|
+
const bLen = that.length;
|
|
1236
|
+
const len = Math.min(aLen, bLen);
|
|
1237
|
+
for (let i2 = 0; i2 < len; i2++) {
|
|
1238
|
+
const o2 = O2(self[i2], that[i2]);
|
|
1239
|
+
if (o2 !== 0) {
|
|
1240
|
+
return o2;
|
|
1241
|
+
}
|
|
1242
|
+
}
|
|
1243
|
+
return number2(aLen, bLen);
|
|
1244
|
+
});
|
|
1245
|
+
var min = (O2) => dual(2, (self, that) => self === that || O2(self, that) < 1 ? self : that);
|
|
1246
|
+
var max = (O2) => dual(2, (self, that) => self === that || O2(self, that) > -1 ? self : that);
|
|
997
1247
|
|
|
998
|
-
// ../../../node_modules/.pnpm/effect@3.
|
|
1248
|
+
// ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Option.js
|
|
999
1249
|
var TypeId3 = /* @__PURE__ */ Symbol.for("effect/Option");
|
|
1000
1250
|
var none2 = () => none;
|
|
1001
1251
|
var some3 = some2;
|
|
@@ -1125,15 +1375,9 @@ var containsWith = (isEquivalent) => dual(2, (self, a2) => isNone2(self) ? false
|
|
|
1125
1375
|
var _equivalence = /* @__PURE__ */ equivalence();
|
|
1126
1376
|
var contains = /* @__PURE__ */ containsWith(_equivalence);
|
|
1127
1377
|
var exists = /* @__PURE__ */ dual(2, (self, refinement) => isNone2(self) ? false : refinement(self.value));
|
|
1128
|
-
var
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
var let_ = /* @__PURE__ */ dual(3, (self, name, f2) => map(self, (a2) => Object.assign({}, a2, {
|
|
1132
|
-
[name]: f2(a2)
|
|
1133
|
-
})));
|
|
1134
|
-
var bind = /* @__PURE__ */ dual(3, (self, name, f2) => flatMap(self, (a2) => map(f2(a2), (b2) => Object.assign({}, a2, {
|
|
1135
|
-
[name]: b2
|
|
1136
|
-
}))));
|
|
1378
|
+
var bindTo2 = /* @__PURE__ */ bindTo(map);
|
|
1379
|
+
var let_2 = /* @__PURE__ */ let_(map);
|
|
1380
|
+
var bind2 = /* @__PURE__ */ bind(map, flatMap);
|
|
1137
1381
|
var Do = /* @__PURE__ */ some3({});
|
|
1138
1382
|
var adapter2 = /* @__PURE__ */ adapter();
|
|
1139
1383
|
var gen = (f2) => {
|
|
@@ -1168,32 +1412,598 @@ var gen = (f2) => {
|
|
|
1168
1412
|
return some3(state.value);
|
|
1169
1413
|
}
|
|
1170
1414
|
};
|
|
1415
|
+
|
|
1416
|
+
// ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Tuple.js
|
|
1417
|
+
var make3 = (...elements) => elements;
|
|
1418
|
+
|
|
1419
|
+
// ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Iterable.js
|
|
1420
|
+
var findFirst = /* @__PURE__ */ dual(2, (self, f2) => {
|
|
1421
|
+
let i2 = 0;
|
|
1422
|
+
for (const a2 of self) {
|
|
1423
|
+
const o2 = f2(a2, i2);
|
|
1424
|
+
if (isBoolean(o2)) {
|
|
1425
|
+
if (o2) {
|
|
1426
|
+
return some3(a2);
|
|
1427
|
+
}
|
|
1428
|
+
} else {
|
|
1429
|
+
if (isSome2(o2)) {
|
|
1430
|
+
return o2;
|
|
1431
|
+
}
|
|
1432
|
+
}
|
|
1433
|
+
i2++;
|
|
1434
|
+
}
|
|
1435
|
+
return none2();
|
|
1436
|
+
});
|
|
1437
|
+
|
|
1438
|
+
// ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Record.js
|
|
1439
|
+
var collect = /* @__PURE__ */ dual(2, (self, f2) => {
|
|
1440
|
+
const out = [];
|
|
1441
|
+
for (const key of keys(self)) {
|
|
1442
|
+
out.push(f2(key, self[key]));
|
|
1443
|
+
}
|
|
1444
|
+
return out;
|
|
1445
|
+
});
|
|
1446
|
+
var toEntries = /* @__PURE__ */ collect((key, value) => [key, value]);
|
|
1447
|
+
var keys = (self) => Object.keys(self);
|
|
1448
|
+
|
|
1449
|
+
// ../../../node_modules/.pnpm/effect@3.1.2/node_modules/effect/dist/esm/Array.js
|
|
1450
|
+
var make4 = (...elements) => elements;
|
|
1451
|
+
var allocate = (n2) => new Array(n2);
|
|
1452
|
+
var makeBy = (n2, f2) => {
|
|
1453
|
+
const max3 = Math.max(1, Math.floor(n2));
|
|
1454
|
+
const out = new Array(max3);
|
|
1455
|
+
for (let i2 = 0; i2 < max3; i2++) {
|
|
1456
|
+
out[i2] = f2(i2);
|
|
1457
|
+
}
|
|
1458
|
+
return out;
|
|
1459
|
+
};
|
|
1460
|
+
var range = (start, end) => start <= end ? makeBy(end - start + 1, (i2) => start + i2) : [start];
|
|
1461
|
+
var replicate = /* @__PURE__ */ dual(2, (a2, n2) => makeBy(n2, () => a2));
|
|
1462
|
+
var fromIterable2 = (collection) => Array.isArray(collection) ? collection : Array.from(collection);
|
|
1463
|
+
var fromRecord = toEntries;
|
|
1464
|
+
var fromOption2 = toArray;
|
|
1465
|
+
var match2 = /* @__PURE__ */ dual(2, (self, {
|
|
1466
|
+
onEmpty,
|
|
1467
|
+
onNonEmpty
|
|
1468
|
+
}) => isNonEmptyReadonlyArray(self) ? onNonEmpty(self) : onEmpty());
|
|
1469
|
+
var matchLeft = /* @__PURE__ */ dual(2, (self, {
|
|
1470
|
+
onEmpty,
|
|
1471
|
+
onNonEmpty
|
|
1472
|
+
}) => isNonEmptyReadonlyArray(self) ? onNonEmpty(headNonEmpty(self), tailNonEmpty(self)) : onEmpty());
|
|
1473
|
+
var matchRight = /* @__PURE__ */ dual(2, (self, {
|
|
1474
|
+
onEmpty,
|
|
1475
|
+
onNonEmpty
|
|
1476
|
+
}) => isNonEmptyReadonlyArray(self) ? onNonEmpty(initNonEmpty(self), lastNonEmpty(self)) : onEmpty());
|
|
1477
|
+
var prepend = /* @__PURE__ */ dual(2, (self, head2) => [head2, ...self]);
|
|
1478
|
+
var prependAll = /* @__PURE__ */ dual(2, (self, that) => fromIterable2(that).concat(fromIterable2(self)));
|
|
1479
|
+
var append = /* @__PURE__ */ dual(2, (self, last2) => [...self, last2]);
|
|
1480
|
+
var appendAll = /* @__PURE__ */ dual(2, (self, that) => fromIterable2(self).concat(fromIterable2(that)));
|
|
1481
|
+
var scan = /* @__PURE__ */ dual(3, (self, b2, f2) => {
|
|
1482
|
+
const out = [b2];
|
|
1483
|
+
let i2 = 0;
|
|
1484
|
+
for (const a2 of self) {
|
|
1485
|
+
out[i2 + 1] = f2(out[i2], a2);
|
|
1486
|
+
i2++;
|
|
1487
|
+
}
|
|
1488
|
+
return out;
|
|
1489
|
+
});
|
|
1490
|
+
var scanRight = /* @__PURE__ */ dual(3, (self, b2, f2) => {
|
|
1491
|
+
const input = fromIterable2(self);
|
|
1492
|
+
const out = new Array(input.length + 1);
|
|
1493
|
+
out[input.length] = b2;
|
|
1494
|
+
for (let i2 = input.length - 1; i2 >= 0; i2--) {
|
|
1495
|
+
out[i2] = f2(out[i2 + 1], input[i2]);
|
|
1496
|
+
}
|
|
1497
|
+
return out;
|
|
1498
|
+
});
|
|
1499
|
+
var isArray = Array.isArray;
|
|
1500
|
+
var isEmptyArray = (self) => self.length === 0;
|
|
1501
|
+
var isEmptyReadonlyArray = isEmptyArray;
|
|
1502
|
+
var isNonEmptyArray2 = isNonEmptyArray;
|
|
1503
|
+
var isNonEmptyReadonlyArray = isNonEmptyArray;
|
|
1504
|
+
var length = (self) => self.length;
|
|
1505
|
+
var isOutOfBound = (i2, as2) => i2 < 0 || i2 >= as2.length;
|
|
1506
|
+
var clamp = (i2, as2) => Math.floor(Math.min(Math.max(0, i2), as2.length));
|
|
1507
|
+
var get = /* @__PURE__ */ dual(2, (self, index) => {
|
|
1508
|
+
const i2 = Math.floor(index);
|
|
1509
|
+
return isOutOfBound(i2, self) ? none2() : some3(self[i2]);
|
|
1510
|
+
});
|
|
1511
|
+
var unsafeGet = /* @__PURE__ */ dual(2, (self, index) => {
|
|
1512
|
+
const i2 = Math.floor(index);
|
|
1513
|
+
if (isOutOfBound(i2, self)) {
|
|
1514
|
+
throw new Error(`Index ${i2} out of bounds`);
|
|
1515
|
+
}
|
|
1516
|
+
return self[i2];
|
|
1517
|
+
});
|
|
1518
|
+
var unprepend = (self) => [headNonEmpty(self), tailNonEmpty(self)];
|
|
1519
|
+
var unappend = (self) => [initNonEmpty(self), lastNonEmpty(self)];
|
|
1520
|
+
var head = /* @__PURE__ */ get(0);
|
|
1521
|
+
var headNonEmpty = /* @__PURE__ */ unsafeGet(0);
|
|
1522
|
+
var last = (self) => isNonEmptyReadonlyArray(self) ? some3(lastNonEmpty(self)) : none2();
|
|
1523
|
+
var lastNonEmpty = (self) => self[self.length - 1];
|
|
1524
|
+
var tail = (self) => {
|
|
1525
|
+
const input = fromIterable2(self);
|
|
1526
|
+
return isNonEmptyReadonlyArray(input) ? some3(tailNonEmpty(input)) : none2();
|
|
1527
|
+
};
|
|
1528
|
+
var tailNonEmpty = (self) => self.slice(1);
|
|
1529
|
+
var init = (self) => {
|
|
1530
|
+
const input = fromIterable2(self);
|
|
1531
|
+
return isNonEmptyReadonlyArray(input) ? some3(initNonEmpty(input)) : none2();
|
|
1532
|
+
};
|
|
1533
|
+
var initNonEmpty = (self) => self.slice(0, -1);
|
|
1534
|
+
var take = /* @__PURE__ */ dual(2, (self, n2) => {
|
|
1535
|
+
const input = fromIterable2(self);
|
|
1536
|
+
return input.slice(0, clamp(n2, input));
|
|
1537
|
+
});
|
|
1538
|
+
var takeRight = /* @__PURE__ */ dual(2, (self, n2) => {
|
|
1539
|
+
const input = fromIterable2(self);
|
|
1540
|
+
const i2 = clamp(n2, input);
|
|
1541
|
+
return i2 === 0 ? [] : input.slice(-i2);
|
|
1542
|
+
});
|
|
1543
|
+
var takeWhile = /* @__PURE__ */ dual(2, (self, predicate) => {
|
|
1544
|
+
let i2 = 0;
|
|
1545
|
+
const out = [];
|
|
1546
|
+
for (const a2 of self) {
|
|
1547
|
+
if (!predicate(a2, i2)) {
|
|
1548
|
+
break;
|
|
1549
|
+
}
|
|
1550
|
+
out.push(a2);
|
|
1551
|
+
i2++;
|
|
1552
|
+
}
|
|
1553
|
+
return out;
|
|
1554
|
+
});
|
|
1555
|
+
var spanIndex = (self, predicate) => {
|
|
1556
|
+
let i2 = 0;
|
|
1557
|
+
for (const a2 of self) {
|
|
1558
|
+
if (!predicate(a2, i2)) {
|
|
1559
|
+
break;
|
|
1560
|
+
}
|
|
1561
|
+
i2++;
|
|
1562
|
+
}
|
|
1563
|
+
return i2;
|
|
1564
|
+
};
|
|
1565
|
+
var span = /* @__PURE__ */ dual(2, (self, predicate) => splitAt(self, spanIndex(self, predicate)));
|
|
1566
|
+
var drop = /* @__PURE__ */ dual(2, (self, n2) => {
|
|
1567
|
+
const input = fromIterable2(self);
|
|
1568
|
+
return input.slice(clamp(n2, input), input.length);
|
|
1569
|
+
});
|
|
1570
|
+
var dropRight = /* @__PURE__ */ dual(2, (self, n2) => {
|
|
1571
|
+
const input = fromIterable2(self);
|
|
1572
|
+
return input.slice(0, input.length - clamp(n2, input));
|
|
1573
|
+
});
|
|
1574
|
+
var dropWhile = /* @__PURE__ */ dual(2, (self, predicate) => fromIterable2(self).slice(spanIndex(self, predicate)));
|
|
1575
|
+
var findFirstIndex = /* @__PURE__ */ dual(2, (self, predicate) => {
|
|
1576
|
+
let i2 = 0;
|
|
1577
|
+
for (const a2 of self) {
|
|
1578
|
+
if (predicate(a2, i2)) {
|
|
1579
|
+
return some3(i2);
|
|
1580
|
+
}
|
|
1581
|
+
i2++;
|
|
1582
|
+
}
|
|
1583
|
+
return none2();
|
|
1584
|
+
});
|
|
1585
|
+
var findLastIndex = /* @__PURE__ */ dual(2, (self, predicate) => {
|
|
1586
|
+
const input = fromIterable2(self);
|
|
1587
|
+
for (let i2 = input.length - 1; i2 >= 0; i2--) {
|
|
1588
|
+
if (predicate(input[i2], i2)) {
|
|
1589
|
+
return some3(i2);
|
|
1590
|
+
}
|
|
1591
|
+
}
|
|
1592
|
+
return none2();
|
|
1593
|
+
});
|
|
1594
|
+
var findFirst2 = findFirst;
|
|
1595
|
+
var findLast = /* @__PURE__ */ dual(2, (self, f2) => {
|
|
1596
|
+
const input = fromIterable2(self);
|
|
1597
|
+
for (let i2 = input.length - 1; i2 >= 0; i2--) {
|
|
1598
|
+
const a2 = input[i2];
|
|
1599
|
+
const o2 = f2(a2, i2);
|
|
1600
|
+
if (isBoolean(o2)) {
|
|
1601
|
+
if (o2) {
|
|
1602
|
+
return some3(a2);
|
|
1603
|
+
}
|
|
1604
|
+
} else {
|
|
1605
|
+
if (isSome2(o2)) {
|
|
1606
|
+
return o2;
|
|
1607
|
+
}
|
|
1608
|
+
}
|
|
1609
|
+
}
|
|
1610
|
+
return none2();
|
|
1611
|
+
});
|
|
1612
|
+
var insertAt = /* @__PURE__ */ dual(3, (self, i2, b2) => {
|
|
1613
|
+
const out = Array.from(self);
|
|
1614
|
+
if (i2 < 0 || i2 > out.length) {
|
|
1615
|
+
return none2();
|
|
1616
|
+
}
|
|
1617
|
+
out.splice(i2, 0, b2);
|
|
1618
|
+
return some3(out);
|
|
1619
|
+
});
|
|
1620
|
+
var replace = /* @__PURE__ */ dual(3, (self, i2, b2) => modify(self, i2, () => b2));
|
|
1621
|
+
var replaceOption = /* @__PURE__ */ dual(3, (self, i2, b2) => modifyOption(self, i2, () => b2));
|
|
1622
|
+
var modify = /* @__PURE__ */ dual(3, (self, i2, f2) => getOrElse(modifyOption(self, i2, f2), () => Array.from(self)));
|
|
1623
|
+
var modifyOption = /* @__PURE__ */ dual(3, (self, i2, f2) => {
|
|
1624
|
+
const out = Array.from(self);
|
|
1625
|
+
if (isOutOfBound(i2, out)) {
|
|
1626
|
+
return none2();
|
|
1627
|
+
}
|
|
1628
|
+
const next = f2(out[i2]);
|
|
1629
|
+
out[i2] = next;
|
|
1630
|
+
return some3(out);
|
|
1631
|
+
});
|
|
1632
|
+
var remove = /* @__PURE__ */ dual(2, (self, i2) => {
|
|
1633
|
+
const out = Array.from(self);
|
|
1634
|
+
if (isOutOfBound(i2, out)) {
|
|
1635
|
+
return out;
|
|
1636
|
+
}
|
|
1637
|
+
out.splice(i2, 1);
|
|
1638
|
+
return out;
|
|
1639
|
+
});
|
|
1640
|
+
var reverse = (self) => Array.from(self).reverse();
|
|
1641
|
+
var sort = /* @__PURE__ */ dual(2, (self, O2) => {
|
|
1642
|
+
const out = Array.from(self);
|
|
1643
|
+
out.sort(O2);
|
|
1644
|
+
return out;
|
|
1645
|
+
});
|
|
1646
|
+
var sortWith = /* @__PURE__ */ dual(3, (self, f2, order) => sort(self, mapInput2(order, f2)));
|
|
1647
|
+
var sortBy = (...orders) => {
|
|
1648
|
+
const sortByAll = sort(combineAll(orders));
|
|
1649
|
+
return (self) => {
|
|
1650
|
+
const input = fromIterable2(self);
|
|
1651
|
+
if (isNonEmptyReadonlyArray(input)) {
|
|
1652
|
+
return sortByAll(input);
|
|
1653
|
+
}
|
|
1654
|
+
return [];
|
|
1655
|
+
};
|
|
1656
|
+
};
|
|
1657
|
+
var zip = /* @__PURE__ */ dual(2, (self, that) => zipWith2(self, that, make3));
|
|
1658
|
+
var zipWith2 = /* @__PURE__ */ dual(3, (self, that, f2) => {
|
|
1659
|
+
const as2 = fromIterable2(self);
|
|
1660
|
+
const bs = fromIterable2(that);
|
|
1661
|
+
if (isNonEmptyReadonlyArray(as2) && isNonEmptyReadonlyArray(bs)) {
|
|
1662
|
+
const out = [f2(headNonEmpty(as2), headNonEmpty(bs))];
|
|
1663
|
+
const len = Math.min(as2.length, bs.length);
|
|
1664
|
+
for (let i2 = 1; i2 < len; i2++) {
|
|
1665
|
+
out[i2] = f2(as2[i2], bs[i2]);
|
|
1666
|
+
}
|
|
1667
|
+
return out;
|
|
1668
|
+
}
|
|
1669
|
+
return [];
|
|
1670
|
+
});
|
|
1671
|
+
var unzip = (self) => {
|
|
1672
|
+
const input = fromIterable2(self);
|
|
1673
|
+
if (isNonEmptyReadonlyArray(input)) {
|
|
1674
|
+
const fa = [input[0][0]];
|
|
1675
|
+
const fb = [input[0][1]];
|
|
1676
|
+
for (let i2 = 1; i2 < input.length; i2++) {
|
|
1677
|
+
fa[i2] = input[i2][0];
|
|
1678
|
+
fb[i2] = input[i2][1];
|
|
1679
|
+
}
|
|
1680
|
+
return [fa, fb];
|
|
1681
|
+
}
|
|
1682
|
+
return [[], []];
|
|
1683
|
+
};
|
|
1684
|
+
var intersperse = /* @__PURE__ */ dual(2, (self, middle) => {
|
|
1685
|
+
const input = fromIterable2(self);
|
|
1686
|
+
if (isNonEmptyReadonlyArray(input)) {
|
|
1687
|
+
const out = [headNonEmpty(input)];
|
|
1688
|
+
const tail2 = tailNonEmpty(input);
|
|
1689
|
+
for (let i2 = 0; i2 < tail2.length; i2++) {
|
|
1690
|
+
if (i2 < tail2.length) {
|
|
1691
|
+
out.push(middle);
|
|
1692
|
+
}
|
|
1693
|
+
out.push(tail2[i2]);
|
|
1694
|
+
}
|
|
1695
|
+
return out;
|
|
1696
|
+
}
|
|
1697
|
+
return [];
|
|
1698
|
+
});
|
|
1699
|
+
var modifyNonEmptyHead = /* @__PURE__ */ dual(2, (self, f2) => [f2(headNonEmpty(self)), ...tailNonEmpty(self)]);
|
|
1700
|
+
var setNonEmptyHead = /* @__PURE__ */ dual(2, (self, b2) => modifyNonEmptyHead(self, () => b2));
|
|
1701
|
+
var modifyNonEmptyLast = /* @__PURE__ */ dual(2, (self, f2) => append(initNonEmpty(self), f2(lastNonEmpty(self))));
|
|
1702
|
+
var setNonEmptyLast = /* @__PURE__ */ dual(2, (self, b2) => modifyNonEmptyLast(self, () => b2));
|
|
1703
|
+
var rotate = /* @__PURE__ */ dual(2, (self, n2) => {
|
|
1704
|
+
const input = fromIterable2(self);
|
|
1705
|
+
if (isNonEmptyReadonlyArray(input)) {
|
|
1706
|
+
const len = input.length;
|
|
1707
|
+
const m2 = Math.round(n2) % len;
|
|
1708
|
+
if (isOutOfBound(Math.abs(m2), input) || m2 === 0) {
|
|
1709
|
+
return copy(input);
|
|
1710
|
+
}
|
|
1711
|
+
if (m2 < 0) {
|
|
1712
|
+
const [f2, s2] = splitNonEmptyAt(input, -m2);
|
|
1713
|
+
return appendAll(s2, f2);
|
|
1714
|
+
} else {
|
|
1715
|
+
return rotate(self, m2 - len);
|
|
1716
|
+
}
|
|
1717
|
+
}
|
|
1718
|
+
return [];
|
|
1719
|
+
});
|
|
1720
|
+
var containsWith2 = (isEquivalent) => dual(2, (self, a2) => {
|
|
1721
|
+
for (const i2 of self) {
|
|
1722
|
+
if (isEquivalent(a2, i2)) {
|
|
1723
|
+
return true;
|
|
1724
|
+
}
|
|
1725
|
+
}
|
|
1726
|
+
return false;
|
|
1727
|
+
});
|
|
1728
|
+
var _equivalence2 = /* @__PURE__ */ equivalence();
|
|
1729
|
+
var contains2 = /* @__PURE__ */ containsWith2(_equivalence2);
|
|
1730
|
+
var chop = /* @__PURE__ */ dual(2, (self, f2) => {
|
|
1731
|
+
const input = fromIterable2(self);
|
|
1732
|
+
if (isNonEmptyReadonlyArray(input)) {
|
|
1733
|
+
const [b2, rest] = f2(input);
|
|
1734
|
+
const out = [b2];
|
|
1735
|
+
let next = rest;
|
|
1736
|
+
while (isNonEmptyArray(next)) {
|
|
1737
|
+
const [b3, rest2] = f2(next);
|
|
1738
|
+
out.push(b3);
|
|
1739
|
+
next = rest2;
|
|
1740
|
+
}
|
|
1741
|
+
return out;
|
|
1742
|
+
}
|
|
1743
|
+
return [];
|
|
1744
|
+
});
|
|
1745
|
+
var splitAt = /* @__PURE__ */ dual(2, (self, n2) => {
|
|
1746
|
+
const input = Array.from(self);
|
|
1747
|
+
const _n = Math.floor(n2);
|
|
1748
|
+
if (isNonEmptyReadonlyArray(input)) {
|
|
1749
|
+
if (_n >= 1) {
|
|
1750
|
+
return splitNonEmptyAt(input, _n);
|
|
1751
|
+
}
|
|
1752
|
+
return [[], input];
|
|
1753
|
+
}
|
|
1754
|
+
return [input, []];
|
|
1755
|
+
});
|
|
1756
|
+
var splitNonEmptyAt = /* @__PURE__ */ dual(2, (self, n2) => {
|
|
1757
|
+
const _n = Math.max(1, Math.floor(n2));
|
|
1758
|
+
return _n >= self.length ? [copy(self), []] : [prepend(self.slice(1, _n), headNonEmpty(self)), self.slice(_n)];
|
|
1759
|
+
});
|
|
1760
|
+
var split = /* @__PURE__ */ dual(2, (self, n2) => {
|
|
1761
|
+
const input = fromIterable2(self);
|
|
1762
|
+
return chunksOf(input, Math.ceil(input.length / Math.floor(n2)));
|
|
1763
|
+
});
|
|
1764
|
+
var splitWhere = /* @__PURE__ */ dual(2, (self, predicate) => span(self, (a2, i2) => !predicate(a2, i2)));
|
|
1765
|
+
var copy = (self) => self.slice();
|
|
1766
|
+
var chunksOf = /* @__PURE__ */ dual(2, (self, n2) => {
|
|
1767
|
+
const input = fromIterable2(self);
|
|
1768
|
+
if (isNonEmptyReadonlyArray(input)) {
|
|
1769
|
+
return chop(input, splitNonEmptyAt(n2));
|
|
1770
|
+
}
|
|
1771
|
+
return [];
|
|
1772
|
+
});
|
|
1773
|
+
var groupWith = /* @__PURE__ */ dual(2, (self, isEquivalent) => chop(self, (as2) => {
|
|
1774
|
+
const h2 = headNonEmpty(as2);
|
|
1775
|
+
const out = [h2];
|
|
1776
|
+
let i2 = 1;
|
|
1777
|
+
for (; i2 < as2.length; i2++) {
|
|
1778
|
+
const a2 = as2[i2];
|
|
1779
|
+
if (isEquivalent(a2, h2)) {
|
|
1780
|
+
out.push(a2);
|
|
1781
|
+
} else {
|
|
1782
|
+
break;
|
|
1783
|
+
}
|
|
1784
|
+
}
|
|
1785
|
+
return [out, as2.slice(i2)];
|
|
1786
|
+
}));
|
|
1787
|
+
var group = /* @__PURE__ */ groupWith(/* @__PURE__ */ equivalence());
|
|
1788
|
+
var groupBy = /* @__PURE__ */ dual(2, (self, f2) => {
|
|
1789
|
+
const out = {};
|
|
1790
|
+
for (const a2 of self) {
|
|
1791
|
+
const k2 = f2(a2);
|
|
1792
|
+
if (Object.prototype.hasOwnProperty.call(out, k2)) {
|
|
1793
|
+
out[k2].push(a2);
|
|
1794
|
+
} else {
|
|
1795
|
+
out[k2] = [a2];
|
|
1796
|
+
}
|
|
1797
|
+
}
|
|
1798
|
+
return out;
|
|
1799
|
+
});
|
|
1800
|
+
var unionWith = /* @__PURE__ */ dual(3, (self, that, isEquivalent) => {
|
|
1801
|
+
const a2 = fromIterable2(self);
|
|
1802
|
+
const b2 = fromIterable2(that);
|
|
1803
|
+
if (isNonEmptyReadonlyArray(a2)) {
|
|
1804
|
+
if (isNonEmptyReadonlyArray(b2)) {
|
|
1805
|
+
const dedupe2 = dedupeWith(isEquivalent);
|
|
1806
|
+
return dedupe2(appendAll(a2, b2));
|
|
1807
|
+
}
|
|
1808
|
+
return a2;
|
|
1809
|
+
}
|
|
1810
|
+
return b2;
|
|
1811
|
+
});
|
|
1812
|
+
var union = /* @__PURE__ */ dual(2, (self, that) => unionWith(self, that, _equivalence2));
|
|
1813
|
+
var intersectionWith = (isEquivalent) => {
|
|
1814
|
+
const has = containsWith2(isEquivalent);
|
|
1815
|
+
return dual(2, (self, that) => fromIterable2(self).filter((a2) => has(that, a2)));
|
|
1816
|
+
};
|
|
1817
|
+
var intersection = /* @__PURE__ */ intersectionWith(_equivalence2);
|
|
1818
|
+
var differenceWith = (isEquivalent) => {
|
|
1819
|
+
const has = containsWith2(isEquivalent);
|
|
1820
|
+
return dual(2, (self, that) => fromIterable2(self).filter((a2) => !has(that, a2)));
|
|
1821
|
+
};
|
|
1822
|
+
var difference = /* @__PURE__ */ differenceWith(_equivalence2);
|
|
1823
|
+
var empty2 = () => [];
|
|
1824
|
+
var of = (a2) => [a2];
|
|
1825
|
+
var map2 = /* @__PURE__ */ dual(2, (self, f2) => self.map(f2));
|
|
1826
|
+
var flatMap2 = /* @__PURE__ */ dual(2, (self, f2) => {
|
|
1827
|
+
if (isEmptyReadonlyArray(self)) {
|
|
1828
|
+
return [];
|
|
1829
|
+
}
|
|
1830
|
+
const out = [];
|
|
1831
|
+
for (let i2 = 0; i2 < self.length; i2++) {
|
|
1832
|
+
const inner = f2(self[i2], i2);
|
|
1833
|
+
for (let j2 = 0; j2 < inner.length; j2++) {
|
|
1834
|
+
out.push(inner[j2]);
|
|
1835
|
+
}
|
|
1836
|
+
}
|
|
1837
|
+
return out;
|
|
1838
|
+
});
|
|
1839
|
+
var flatten2 = /* @__PURE__ */ flatMap2(identity);
|
|
1840
|
+
var filterMap2 = /* @__PURE__ */ dual(2, (self, f2) => {
|
|
1841
|
+
const as2 = fromIterable2(self);
|
|
1842
|
+
const out = [];
|
|
1843
|
+
for (let i2 = 0; i2 < as2.length; i2++) {
|
|
1844
|
+
const o2 = f2(as2[i2], i2);
|
|
1845
|
+
if (isSome2(o2)) {
|
|
1846
|
+
out.push(o2.value);
|
|
1847
|
+
}
|
|
1848
|
+
}
|
|
1849
|
+
return out;
|
|
1850
|
+
});
|
|
1851
|
+
var filterMapWhile = /* @__PURE__ */ dual(2, (self, f2) => {
|
|
1852
|
+
let i2 = 0;
|
|
1853
|
+
const out = [];
|
|
1854
|
+
for (const a2 of self) {
|
|
1855
|
+
const b2 = f2(a2, i2);
|
|
1856
|
+
if (isSome2(b2)) {
|
|
1857
|
+
out.push(b2.value);
|
|
1858
|
+
} else {
|
|
1859
|
+
break;
|
|
1860
|
+
}
|
|
1861
|
+
i2++;
|
|
1862
|
+
}
|
|
1863
|
+
return out;
|
|
1864
|
+
});
|
|
1865
|
+
var partitionMap2 = /* @__PURE__ */ dual(2, (self, f2) => {
|
|
1866
|
+
const left2 = [];
|
|
1867
|
+
const right2 = [];
|
|
1868
|
+
const as2 = fromIterable2(self);
|
|
1869
|
+
for (let i2 = 0; i2 < as2.length; i2++) {
|
|
1870
|
+
const e2 = f2(as2[i2], i2);
|
|
1871
|
+
if (isLeft2(e2)) {
|
|
1872
|
+
left2.push(e2.left);
|
|
1873
|
+
} else {
|
|
1874
|
+
right2.push(e2.right);
|
|
1875
|
+
}
|
|
1876
|
+
}
|
|
1877
|
+
return [left2, right2];
|
|
1878
|
+
});
|
|
1879
|
+
var getSomes = /* @__PURE__ */ filterMap2(identity);
|
|
1880
|
+
var getLefts = (self) => {
|
|
1881
|
+
const out = [];
|
|
1882
|
+
for (const a2 of self) {
|
|
1883
|
+
if (isLeft2(a2)) {
|
|
1884
|
+
out.push(a2.left);
|
|
1885
|
+
}
|
|
1886
|
+
}
|
|
1887
|
+
return out;
|
|
1888
|
+
};
|
|
1889
|
+
var getRights = (self) => {
|
|
1890
|
+
const out = [];
|
|
1891
|
+
for (const a2 of self) {
|
|
1892
|
+
if (isRight2(a2)) {
|
|
1893
|
+
out.push(a2.right);
|
|
1894
|
+
}
|
|
1895
|
+
}
|
|
1896
|
+
return out;
|
|
1897
|
+
};
|
|
1898
|
+
var filter2 = /* @__PURE__ */ dual(2, (self, predicate) => {
|
|
1899
|
+
const as2 = fromIterable2(self);
|
|
1900
|
+
const out = [];
|
|
1901
|
+
for (let i2 = 0; i2 < as2.length; i2++) {
|
|
1902
|
+
if (predicate(as2[i2], i2)) {
|
|
1903
|
+
out.push(as2[i2]);
|
|
1904
|
+
}
|
|
1905
|
+
}
|
|
1906
|
+
return out;
|
|
1907
|
+
});
|
|
1908
|
+
var partition = /* @__PURE__ */ dual(2, (self, predicate) => {
|
|
1909
|
+
const left2 = [];
|
|
1910
|
+
const right2 = [];
|
|
1911
|
+
const as2 = fromIterable2(self);
|
|
1912
|
+
for (let i2 = 0; i2 < as2.length; i2++) {
|
|
1913
|
+
if (predicate(as2[i2], i2)) {
|
|
1914
|
+
right2.push(as2[i2]);
|
|
1915
|
+
} else {
|
|
1916
|
+
left2.push(as2[i2]);
|
|
1917
|
+
}
|
|
1918
|
+
}
|
|
1919
|
+
return [left2, right2];
|
|
1920
|
+
});
|
|
1921
|
+
var separate = /* @__PURE__ */ partitionMap2(identity);
|
|
1922
|
+
var reduce = /* @__PURE__ */ dual(3, (self, b2, f2) => fromIterable2(self).reduce((b3, a2, i2) => f2(b3, a2, i2), b2));
|
|
1923
|
+
var reduceRight = /* @__PURE__ */ dual(3, (self, b2, f2) => fromIterable2(self).reduceRight((b3, a2, i2) => f2(b3, a2, i2), b2));
|
|
1924
|
+
var liftPredicate2 = (predicate) => (b2) => predicate(b2) ? [b2] : [];
|
|
1925
|
+
var liftOption = (f2) => (...a2) => fromOption2(f2(...a2));
|
|
1926
|
+
var fromNullable2 = (a2) => a2 == null ? empty2() : [a2];
|
|
1927
|
+
var liftNullable2 = (f2) => (...a2) => fromNullable2(f2(...a2));
|
|
1928
|
+
var flatMapNullable2 = /* @__PURE__ */ dual(2, (self, f2) => isNonEmptyReadonlyArray(self) ? fromNullable2(f2(headNonEmpty(self))) : empty2());
|
|
1929
|
+
var liftEither = (f2) => (...a2) => {
|
|
1930
|
+
const e2 = f2(...a2);
|
|
1931
|
+
return isLeft2(e2) ? [] : [e2.right];
|
|
1932
|
+
};
|
|
1933
|
+
var every2 = /* @__PURE__ */ dual(2, (self, refinement) => self.every(refinement));
|
|
1934
|
+
var some4 = /* @__PURE__ */ dual(2, (self, predicate) => self.some(predicate));
|
|
1935
|
+
var extend = /* @__PURE__ */ dual(2, (self, f2) => self.map((_2, i2, as2) => f2(as2.slice(i2))));
|
|
1936
|
+
var min2 = /* @__PURE__ */ dual(2, (self, O2) => self.reduce(min(O2)));
|
|
1937
|
+
var max2 = /* @__PURE__ */ dual(2, (self, O2) => self.reduce(max(O2)));
|
|
1938
|
+
var unfold = (b2, f2) => {
|
|
1939
|
+
const out = [];
|
|
1940
|
+
let next = b2;
|
|
1941
|
+
let o2;
|
|
1942
|
+
while (isSome2(o2 = f2(next))) {
|
|
1943
|
+
const [a2, b3] = o2.value;
|
|
1944
|
+
out.push(a2);
|
|
1945
|
+
next = b3;
|
|
1946
|
+
}
|
|
1947
|
+
return out;
|
|
1948
|
+
};
|
|
1949
|
+
var getOrder2 = array2;
|
|
1950
|
+
var getEquivalence2 = array;
|
|
1951
|
+
var forEach = /* @__PURE__ */ dual(2, (self, f2) => fromIterable2(self).forEach((a2, i2) => f2(a2, i2)));
|
|
1952
|
+
var dedupeWith = /* @__PURE__ */ dual(2, (self, isEquivalent) => {
|
|
1953
|
+
const input = fromIterable2(self);
|
|
1954
|
+
if (isNonEmptyReadonlyArray(input)) {
|
|
1955
|
+
const out = [headNonEmpty(input)];
|
|
1956
|
+
const rest = tailNonEmpty(input);
|
|
1957
|
+
for (const r2 of rest) {
|
|
1958
|
+
if (out.every((a2) => !isEquivalent(r2, a2))) {
|
|
1959
|
+
out.push(r2);
|
|
1960
|
+
}
|
|
1961
|
+
}
|
|
1962
|
+
return out;
|
|
1963
|
+
}
|
|
1964
|
+
return [];
|
|
1965
|
+
});
|
|
1966
|
+
var dedupe = (self) => dedupeWith(self, equivalence());
|
|
1967
|
+
var dedupeAdjacentWith = /* @__PURE__ */ dual(2, (self, isEquivalent) => {
|
|
1968
|
+
const out = [];
|
|
1969
|
+
let lastA = none2();
|
|
1970
|
+
for (const a2 of self) {
|
|
1971
|
+
if (isNone2(lastA) || !isEquivalent(a2, lastA.value)) {
|
|
1972
|
+
out.push(a2);
|
|
1973
|
+
lastA = some3(a2);
|
|
1974
|
+
}
|
|
1975
|
+
}
|
|
1976
|
+
return out;
|
|
1977
|
+
});
|
|
1978
|
+
var dedupeAdjacent = /* @__PURE__ */ dedupeAdjacentWith(/* @__PURE__ */ equivalence());
|
|
1979
|
+
var join = /* @__PURE__ */ dual(2, (self, sep) => fromIterable2(self).join(sep));
|
|
1980
|
+
var mapAccum = /* @__PURE__ */ dual(3, (self, s2, f2) => {
|
|
1981
|
+
let i2 = 0;
|
|
1982
|
+
let s1 = s2;
|
|
1983
|
+
const out = [];
|
|
1984
|
+
for (const a2 of self) {
|
|
1985
|
+
const r2 = f2(s1, a2, i2);
|
|
1986
|
+
s1 = r2[0];
|
|
1987
|
+
out.push(r2[1]);
|
|
1988
|
+
i2++;
|
|
1989
|
+
}
|
|
1990
|
+
return [s1, out];
|
|
1991
|
+
});
|
|
1992
|
+
var cartesianWith = /* @__PURE__ */ dual(3, (self, that, f2) => flatMap2(self, (a2) => map2(that, (b2) => f2(a2, b2))));
|
|
1993
|
+
var cartesian = /* @__PURE__ */ dual(2, (self, that) => cartesianWith(self, that, (a2, b2) => [a2, b2]));
|
|
1994
|
+
|
|
1995
|
+
// src/pragma.ts
|
|
1171
1996
|
var RE_JSX_ANNOTATION_REGEX = /@jsx\s+(\S+)/u;
|
|
1172
1997
|
var RE_JS_IDENTIFIER_REGEX = /^[$A-Z_a-z][\w$]*$/u;
|
|
1173
|
-
function
|
|
1174
|
-
const
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1998
|
+
function getJSXPragmaFromContext(context) {
|
|
1999
|
+
const { sourceCode } = context;
|
|
2000
|
+
return Function_exports.pipe(
|
|
2001
|
+
Array_exports.findFirst(sourceCode.getAllComments(), (node) => RE_JSX_ANNOTATION_REGEX.test(node.value)),
|
|
2002
|
+
Option_exports.map(({ value }) => RE_JSX_ANNOTATION_REGEX.exec(value)),
|
|
2003
|
+
Option_exports.flatMapNullable((matches) => matches?.[1]),
|
|
2004
|
+
Option_exports.filter((pragma) => RE_JS_IDENTIFIER_REGEX.test(pragma))
|
|
2005
|
+
);
|
|
1179
2006
|
}
|
|
1180
|
-
var getPragmaFromContext = memo__default.default(
|
|
1181
|
-
(context) => {
|
|
1182
|
-
const settings = shared.parseSchema(shared.ESLintSettingsSchema, context.settings);
|
|
1183
|
-
const pragma = settings.reactOptions?.jsxPragma;
|
|
1184
|
-
const { sourceCode } = context;
|
|
1185
|
-
const pragmaNode = sourceCode.getAllComments().find((node) => RE_JSX_ANNOTATION_REGEX.test(node.value));
|
|
1186
|
-
return Function_exports.pipe(
|
|
1187
|
-
Option_exports.orElse(Option_exports.fromNullable(pragma), () => Function_exports.pipe(
|
|
1188
|
-
Option_exports.fromNullable(pragmaNode),
|
|
1189
|
-
Option_exports.map(({ value }) => RE_JSX_ANNOTATION_REGEX.exec(value)),
|
|
1190
|
-
Option_exports.flatMapNullable((matches) => matches?.[1]?.split(".")[0])
|
|
1191
|
-
)),
|
|
1192
|
-
Option_exports.flatMap(Option_exports.liftPredicate((x2) => RE_JS_IDENTIFIER_REGEX.test(x2))),
|
|
1193
|
-
Option_exports.getOrElse(Function_exports.constant("React"))
|
|
1194
|
-
);
|
|
1195
|
-
}
|
|
1196
|
-
);
|
|
1197
2007
|
|
|
1198
2008
|
// ../../../node_modules/.pnpm/ts-pattern@5.1.1/node_modules/ts-pattern/dist/index.js
|
|
1199
2009
|
var t = Symbol.for("@ts-pattern/matcher");
|
|
@@ -1470,249 +2280,7 @@ var z = class _z {
|
|
|
1470
2280
|
}
|
|
1471
2281
|
};
|
|
1472
2282
|
|
|
1473
|
-
// src/
|
|
1474
|
-
function isInitializedFromPragma(variableName, context, initialScope, pragma = getPragmaFromContext(context)) {
|
|
1475
|
-
const maybeVariable = _var.findVariable(variableName, initialScope);
|
|
1476
|
-
const maybeLatestDef = Option_exports.flatMapNullable(maybeVariable, (variable) => variable.defs.at(-1));
|
|
1477
|
-
if (Option_exports.isNone(maybeLatestDef))
|
|
1478
|
-
return false;
|
|
1479
|
-
const latestDef = maybeLatestDef.value;
|
|
1480
|
-
const { node, parent } = latestDef;
|
|
1481
|
-
if (node.type === ast.NodeType.VariableDeclarator && node.init) {
|
|
1482
|
-
const { init } = node;
|
|
1483
|
-
if (a({ type: "MemberExpression", object: { type: "Identifier", name: pragma } }, init))
|
|
1484
|
-
return true;
|
|
1485
|
-
if (a({ type: "Identifier", name: pragma }, init))
|
|
1486
|
-
return true;
|
|
1487
|
-
const maybeRequireExpression = $(init).with({
|
|
1488
|
-
type: ast.NodeType.CallExpression,
|
|
1489
|
-
callee: { type: ast.NodeType.Identifier, name: "require" }
|
|
1490
|
-
}, (exp) => Option_exports.some(exp)).with(
|
|
1491
|
-
{
|
|
1492
|
-
type: ast.NodeType.MemberExpression,
|
|
1493
|
-
object: {
|
|
1494
|
-
type: ast.NodeType.CallExpression,
|
|
1495
|
-
callee: { type: ast.NodeType.Identifier, name: "require" }
|
|
1496
|
-
}
|
|
1497
|
-
},
|
|
1498
|
-
({ object }) => Option_exports.some(object)
|
|
1499
|
-
).otherwise(Option_exports.none);
|
|
1500
|
-
if (Option_exports.isNone(maybeRequireExpression))
|
|
1501
|
-
return false;
|
|
1502
|
-
const requireExpression = maybeRequireExpression.value;
|
|
1503
|
-
const [firstArg] = requireExpression.arguments;
|
|
1504
|
-
if (firstArg?.type !== ast.NodeType.Literal)
|
|
1505
|
-
return false;
|
|
1506
|
-
return firstArg.value === pragma.toLowerCase();
|
|
1507
|
-
}
|
|
1508
|
-
return a({ type: "ImportDeclaration", source: { value: pragma.toLowerCase() } }, parent);
|
|
1509
|
-
}
|
|
1510
|
-
function isPropertyOfPragma(name, context, pragma = getPragmaFromContext(context)) {
|
|
1511
|
-
const isMatch = a({
|
|
1512
|
-
type: ast.NodeType.MemberExpression,
|
|
1513
|
-
object: {
|
|
1514
|
-
type: ast.NodeType.Identifier,
|
|
1515
|
-
name: pragma
|
|
1516
|
-
},
|
|
1517
|
-
property: {
|
|
1518
|
-
name
|
|
1519
|
-
}
|
|
1520
|
-
});
|
|
1521
|
-
return isMatch;
|
|
1522
|
-
}
|
|
1523
|
-
function isFromPragma(name) {
|
|
1524
|
-
return (node, context) => {
|
|
1525
|
-
const initialScope = context.sourceCode.getScope(node);
|
|
1526
|
-
if (node.type === ast.NodeType.MemberExpression)
|
|
1527
|
-
return isPropertyOfPragma(name, context)(node);
|
|
1528
|
-
if (node.name === name)
|
|
1529
|
-
return isInitializedFromPragma(name, context, initialScope);
|
|
1530
|
-
return false;
|
|
1531
|
-
};
|
|
1532
|
-
}
|
|
1533
|
-
function isFromPragmaMember(pragmaMemberName, name) {
|
|
1534
|
-
return (node, context, pragma = getPragmaFromContext(context)) => {
|
|
1535
|
-
const initialScope = context.sourceCode.getScope(node);
|
|
1536
|
-
if (node.property.type !== ast.NodeType.Identifier || node.property.name !== name)
|
|
1537
|
-
return false;
|
|
1538
|
-
if (node.object.type === ast.NodeType.Identifier && node.object.name === pragmaMemberName) {
|
|
1539
|
-
return isInitializedFromPragma(node.object.name, context, initialScope, pragma);
|
|
1540
|
-
}
|
|
1541
|
-
if (node.object.type === ast.NodeType.MemberExpression && node.object.object.type === ast.NodeType.Identifier && node.object.object.name === pragma && node.object.property.type === ast.NodeType.Identifier) {
|
|
1542
|
-
return node.object.property.name === pragmaMemberName;
|
|
1543
|
-
}
|
|
1544
|
-
return false;
|
|
1545
|
-
};
|
|
1546
|
-
}
|
|
1547
|
-
function isCallFromPragma(name) {
|
|
1548
|
-
return (node, context) => {
|
|
1549
|
-
if (!ast.isOneOf([ast.NodeType.Identifier, ast.NodeType.MemberExpression])(node.callee))
|
|
1550
|
-
return false;
|
|
1551
|
-
return isFromPragma(name)(node.callee, context);
|
|
1552
|
-
};
|
|
1553
|
-
}
|
|
1554
|
-
function isCallFromPragmaMember(pragmaMemberName, name) {
|
|
1555
|
-
return (node, context) => {
|
|
1556
|
-
if (!ast.is(ast.NodeType.MemberExpression)(node.callee))
|
|
1557
|
-
return false;
|
|
1558
|
-
return isFromPragmaMember(pragmaMemberName, name)(node.callee, context);
|
|
1559
|
-
};
|
|
1560
|
-
}
|
|
1561
|
-
|
|
1562
|
-
// src/element/api.ts
|
|
1563
|
-
var isCreateElement = isFromPragma("createElement");
|
|
1564
|
-
var isCreateElementCall = (node, context) => {
|
|
1565
|
-
if (!ast.isOneOf([ast.NodeType.Identifier, ast.NodeType.MemberExpression])(node.callee))
|
|
1566
|
-
return false;
|
|
1567
|
-
return isCreateElement(node.callee, context);
|
|
1568
|
-
};
|
|
1569
|
-
var isCloneElement = isFromPragma("cloneElement");
|
|
1570
|
-
var isCloneElementCall = (node, context) => {
|
|
1571
|
-
if (!ast.isOneOf([ast.NodeType.Identifier, ast.NodeType.MemberExpression])(node.callee))
|
|
1572
|
-
return false;
|
|
1573
|
-
return isCloneElement(node.callee, context);
|
|
1574
|
-
};
|
|
1575
|
-
function resolveMemberExpressions(object, property) {
|
|
1576
|
-
if (object.type === types.AST_NODE_TYPES.JSXMemberExpression) {
|
|
1577
|
-
return `${resolveMemberExpressions(object.object, object.property)}.${property.name}`;
|
|
1578
|
-
}
|
|
1579
|
-
if (object.type === types.AST_NODE_TYPES.JSXNamespacedName) {
|
|
1580
|
-
return `${object.namespace.name}:${object.name.name}.${property.name}`;
|
|
1581
|
-
}
|
|
1582
|
-
return `${object.name}.${property.name}`;
|
|
1583
|
-
}
|
|
1584
|
-
function elementType(node) {
|
|
1585
|
-
if (node.type === types.AST_NODE_TYPES.JSXOpeningFragment) {
|
|
1586
|
-
return "<>";
|
|
1587
|
-
}
|
|
1588
|
-
const { name } = node;
|
|
1589
|
-
if (name.type === types.AST_NODE_TYPES.JSXMemberExpression) {
|
|
1590
|
-
const { object, property } = name;
|
|
1591
|
-
return resolveMemberExpressions(object, property);
|
|
1592
|
-
}
|
|
1593
|
-
if (name.type === types.AST_NODE_TYPES.JSXNamespacedName) {
|
|
1594
|
-
return `${name.namespace.name}:${name.name.name}`;
|
|
1595
|
-
}
|
|
1596
|
-
return name.name;
|
|
1597
|
-
}
|
|
1598
|
-
function isInsideCreateElementProps(node, context) {
|
|
1599
|
-
return Function_exports.pipe(
|
|
1600
|
-
ast.traverseUp(node, (n2) => ast.is(ast.NodeType.CallExpression)(n2) && isCreateElementCall(n2, context)),
|
|
1601
|
-
Option_exports.filter(ast.is(ast.NodeType.CallExpression)),
|
|
1602
|
-
Option_exports.flatMapNullable((c2) => c2.arguments.at(1)),
|
|
1603
|
-
Option_exports.filter(ast.is(ast.NodeType.ObjectExpression)),
|
|
1604
|
-
Option_exports.zipWith(ast.traverseUp(node, ast.is(ast.NodeType.ObjectExpression)), (a2, b2) => a2 === b2),
|
|
1605
|
-
Option_exports.getOrElse(Function_exports.constFalse)
|
|
1606
|
-
);
|
|
1607
|
-
}
|
|
1608
|
-
function isChildrenOfCreateElement(node, context) {
|
|
1609
|
-
return Function_exports.pipe(
|
|
1610
|
-
Option_exports.fromNullable(node.parent),
|
|
1611
|
-
Option_exports.filter(ast.is(ast.NodeType.CallExpression)),
|
|
1612
|
-
Option_exports.filter((n2) => isCreateElementCall(n2, context)),
|
|
1613
|
-
Option_exports.exists(
|
|
1614
|
-
(n2) => n2.arguments.slice(2).some((arg) => arg === node)
|
|
1615
|
-
)
|
|
1616
|
-
);
|
|
1617
|
-
}
|
|
1618
|
-
function hasChildren(node, predicate) {
|
|
1619
|
-
if (Predicate_exports.isFunction(predicate))
|
|
1620
|
-
return node.children.some(predicate);
|
|
1621
|
-
return node.children.length > 0;
|
|
1622
|
-
}
|
|
1623
|
-
function isChildOfJSXElement(node) {
|
|
1624
|
-
return node.parent?.type === ast.NodeType.JSXElement && node.parent.children.some((child) => child === node);
|
|
1625
|
-
}
|
|
1626
|
-
function isJSXElementOfUserDefinedComponent(node) {
|
|
1627
|
-
return node.openingElement.name.type === ast.NodeType.JSXIdentifier && /^[A-Z]/u.test(node.openingElement.name.name);
|
|
1628
|
-
}
|
|
1629
|
-
function isJSXElementOfBuiltinComponent(node) {
|
|
1630
|
-
return node.openingElement.name.type === ast.NodeType.JSXIdentifier && node.openingElement.name.name.toLowerCase() === node.openingElement.name.name && /^[a-z]/u.test(node.openingElement.name.name);
|
|
1631
|
-
}
|
|
1632
|
-
var isFragment = (node, pragma, fragment) => {
|
|
1633
|
-
if (!ast.isOneOf([ast.NodeType.JSXElement, ast.NodeType.JSXFragment])(node))
|
|
1634
|
-
return false;
|
|
1635
|
-
return isFragmentSyntax(node) || isFragmentElement(node, pragma, fragment);
|
|
1636
|
-
};
|
|
1637
|
-
var isFragmentSyntax = ast.is(ast.NodeType.JSXFragment);
|
|
1638
|
-
function isFragmentElement(node, pragma, fragment) {
|
|
1639
|
-
const { name } = node.openingElement;
|
|
1640
|
-
if (name.type === ast.NodeType.JSXIdentifier && name.name === fragment)
|
|
1641
|
-
return true;
|
|
1642
|
-
return name.type === ast.NodeType.JSXMemberExpression && name.object.type === ast.NodeType.JSXIdentifier && name.object.name === pragma && name.property.name === fragment;
|
|
1643
|
-
}
|
|
1644
|
-
var JSXValueHint = {
|
|
1645
|
-
None: 0n,
|
|
1646
|
-
SkipNullLiteral: 1n << 0n,
|
|
1647
|
-
SkipUndefinedLiteral: 1n << 1n,
|
|
1648
|
-
SkipBooleanLiteral: 1n << 2n,
|
|
1649
|
-
SkipStringLiteral: 1n << 3n,
|
|
1650
|
-
SkipNumberLiteral: 1n << 4n,
|
|
1651
|
-
SkipCreateElement: 1n << 5n,
|
|
1652
|
-
StrictArray: 1n << 6n,
|
|
1653
|
-
StrictLogical: 1n << 7n,
|
|
1654
|
-
StrictConditional: 1n << 8n
|
|
1655
|
-
};
|
|
1656
|
-
var DEFAULT_JSX_VALUE_HINT = JSXValueHint.SkipUndefinedLiteral | JSXValueHint.SkipBooleanLiteral;
|
|
1657
|
-
function isJSXValue(node, context, hint = DEFAULT_JSX_VALUE_HINT) {
|
|
1658
|
-
if (!node)
|
|
1659
|
-
return false;
|
|
1660
|
-
return $(node).with({ type: ast.NodeType.JSXElement }, Function_exports.constTrue).with({ type: ast.NodeType.JSXFragment }, Function_exports.constTrue).with({ type: ast.NodeType.JSXMemberExpression }, Function_exports.constTrue).with({ type: ast.NodeType.JSXNamespacedName }, Function_exports.constTrue).with({ type: ast.NodeType.Literal }, (node2) => {
|
|
1661
|
-
return $(node2.value).with(null, () => !(hint & JSXValueHint.SkipNullLiteral)).with(N.boolean, () => !(hint & JSXValueHint.SkipBooleanLiteral)).with(N.string, () => !(hint & JSXValueHint.SkipStringLiteral)).with(N.number, () => !(hint & JSXValueHint.SkipNumberLiteral)).otherwise(Function_exports.constFalse);
|
|
1662
|
-
}).with({ type: ast.NodeType.TemplateLiteral }, () => !(hint & JSXValueHint.SkipStringLiteral)).with({ type: ast.NodeType.ArrayExpression }, (node2) => {
|
|
1663
|
-
if (hint & JSXValueHint.StrictArray)
|
|
1664
|
-
return node2.elements.every((n2) => isJSXValue(n2, context, hint));
|
|
1665
|
-
return node2.elements.some((n2) => isJSXValue(n2, context, hint));
|
|
1666
|
-
}).with({ type: ast.NodeType.ConditionalExpression }, (node2) => {
|
|
1667
|
-
function leftHasJSX(node3) {
|
|
1668
|
-
if (Array.isArray(node3.consequent)) {
|
|
1669
|
-
if (hint & JSXValueHint.StrictArray) {
|
|
1670
|
-
return node3.consequent.every((n2) => isJSXValue(n2, context, hint));
|
|
1671
|
-
}
|
|
1672
|
-
return node3.consequent.some((n2) => isJSXValue(n2, context, hint));
|
|
1673
|
-
}
|
|
1674
|
-
return isJSXValue(node3.consequent, context, hint);
|
|
1675
|
-
}
|
|
1676
|
-
function rightHasJSX(node3) {
|
|
1677
|
-
return isJSXValue(node3.alternate, context, hint);
|
|
1678
|
-
}
|
|
1679
|
-
if (hint & JSXValueHint.StrictConditional) {
|
|
1680
|
-
return leftHasJSX(node2) && rightHasJSX(node2);
|
|
1681
|
-
}
|
|
1682
|
-
return leftHasJSX(node2) || rightHasJSX(node2);
|
|
1683
|
-
}).with({ type: ast.NodeType.LogicalExpression }, (node2) => {
|
|
1684
|
-
return isJSXValue(node2.left, context, hint) || isJSXValue(node2.right, context, hint);
|
|
1685
|
-
}).with({ type: ast.NodeType.SequenceExpression }, (node2) => {
|
|
1686
|
-
const exp = node2.expressions.at(-1);
|
|
1687
|
-
return isJSXValue(exp, context, hint);
|
|
1688
|
-
}).with({ type: ast.NodeType.CallExpression }, (node2) => {
|
|
1689
|
-
if (hint & JSXValueHint.SkipCreateElement)
|
|
1690
|
-
return false;
|
|
1691
|
-
return isCreateElementCall(node2, context);
|
|
1692
|
-
}).with({ type: ast.NodeType.Identifier }, (node2) => {
|
|
1693
|
-
const { name } = node2;
|
|
1694
|
-
if (name === "undefined")
|
|
1695
|
-
return !(hint & JSXValueHint.SkipUndefinedLiteral);
|
|
1696
|
-
if (ast.isJSXTagNameExpression(node2))
|
|
1697
|
-
return true;
|
|
1698
|
-
const initialScope = context.sourceCode.getScope(node2);
|
|
1699
|
-
const maybeVariable = _var.findVariable(name, initialScope);
|
|
1700
|
-
return Function_exports.pipe(
|
|
1701
|
-
maybeVariable,
|
|
1702
|
-
Option_exports.flatMap(_var.getVariableInit(0)),
|
|
1703
|
-
Option_exports.exists((n2) => isJSXValue(n2, context, hint))
|
|
1704
|
-
);
|
|
1705
|
-
}).otherwise(Function_exports.constFalse);
|
|
1706
|
-
}
|
|
1707
|
-
|
|
1708
|
-
// src/misc.ts
|
|
1709
|
-
function isFunctionReturningJSXValue(node, context, hint = DEFAULT_JSX_VALUE_HINT) {
|
|
1710
|
-
if (node.body.type !== ast.NodeType.BlockStatement) {
|
|
1711
|
-
return isJSXValue(node.body, context, hint);
|
|
1712
|
-
}
|
|
1713
|
-
const statements = ast.getNestedReturnStatements(node.body);
|
|
1714
|
-
return statements.some((statement) => isJSXValue(statement.argument, context, hint));
|
|
1715
|
-
}
|
|
2283
|
+
// src/prop/get-prop.ts
|
|
1716
2284
|
var { getStaticValue } = ast.ESLintCommunityESLintUtils;
|
|
1717
2285
|
function getPropName(node) {
|
|
1718
2286
|
return $(node.name).when(ast.is(ast.NodeType.JSXIdentifier), (n2) => n2.name).when(ast.is(ast.NodeType.JSXNamespacedName), (n2) => `${n2.namespace.name}:${n2.name.name}`).exhaustive();
|
|
@@ -1750,13 +2318,13 @@ function findPropInProperties(properties, context, initialScope, seenProps = [])
|
|
|
1750
2318
|
);
|
|
1751
2319
|
if (Option_exports.isNone(maybeInit))
|
|
1752
2320
|
return false;
|
|
1753
|
-
const
|
|
1754
|
-
if (
|
|
2321
|
+
const init2 = maybeInit.value;
|
|
2322
|
+
if (init2.type !== ast.NodeType.ObjectExpression)
|
|
1755
2323
|
return false;
|
|
1756
2324
|
if (seenProps.includes(name))
|
|
1757
2325
|
return false;
|
|
1758
2326
|
return Option_exports.isSome(
|
|
1759
|
-
findPropInProperties(
|
|
2327
|
+
findPropInProperties(init2.properties, context, initialScope, [...seenProps, name])(propName)
|
|
1760
2328
|
);
|
|
1761
2329
|
}).when(ast.is(ast.NodeType.ObjectExpression), (argument) => {
|
|
1762
2330
|
return Option_exports.isSome(findPropInProperties(argument.properties, context, initialScope, seenProps)(propName));
|
|
@@ -1783,10 +2351,10 @@ function findPropInAttributes(attributes, context, initialScope) {
|
|
|
1783
2351
|
);
|
|
1784
2352
|
if (Option_exports.isNone(maybeInit))
|
|
1785
2353
|
return false;
|
|
1786
|
-
const
|
|
1787
|
-
if (!("properties" in
|
|
2354
|
+
const init2 = maybeInit.value;
|
|
2355
|
+
if (!("properties" in init2))
|
|
1788
2356
|
return false;
|
|
1789
|
-
return Option_exports.isSome(findPropInProperties(
|
|
2357
|
+
return Option_exports.isSome(findPropInProperties(init2.properties, context, initialScope)(propName));
|
|
1790
2358
|
}).when(ast.is(ast.NodeType.ObjectExpression), (argument) => {
|
|
1791
2359
|
return Option_exports.isSome(findPropInProperties(argument.properties, context, initialScope)(propName));
|
|
1792
2360
|
}).when(ast.is(ast.NodeType.MemberExpression), () => {
|
|
@@ -1833,37 +2401,82 @@ function isLineBreak(node) {
|
|
|
1833
2401
|
function isPaddingSpaces(node) {
|
|
1834
2402
|
return isLiteral(node) && isWhiteSpace(node) && node.raw.includes("\n");
|
|
1835
2403
|
}
|
|
2404
|
+
var JSXValueHint = {
|
|
2405
|
+
None: 0n,
|
|
2406
|
+
SkipNullLiteral: 1n << 0n,
|
|
2407
|
+
SkipUndefinedLiteral: 1n << 1n,
|
|
2408
|
+
SkipBooleanLiteral: 1n << 2n,
|
|
2409
|
+
SkipStringLiteral: 1n << 3n,
|
|
2410
|
+
SkipNumberLiteral: 1n << 4n,
|
|
2411
|
+
SkipCreateElement: 1n << 5n,
|
|
2412
|
+
StrictArray: 1n << 6n,
|
|
2413
|
+
StrictLogical: 1n << 7n,
|
|
2414
|
+
StrictConditional: 1n << 8n
|
|
2415
|
+
};
|
|
2416
|
+
var DEFAULT_JSX_VALUE_HINT = JSXValueHint.SkipUndefinedLiteral | JSXValueHint.SkipBooleanLiteral;
|
|
2417
|
+
function isJSXValue(node, context, hint = DEFAULT_JSX_VALUE_HINT) {
|
|
2418
|
+
if (!node)
|
|
2419
|
+
return false;
|
|
2420
|
+
return $(node).with({ type: ast.NodeType.JSXElement }, Function_exports.constTrue).with({ type: ast.NodeType.JSXFragment }, Function_exports.constTrue).with({ type: ast.NodeType.JSXMemberExpression }, Function_exports.constTrue).with({ type: ast.NodeType.JSXNamespacedName }, Function_exports.constTrue).with({ type: ast.NodeType.Literal }, (node2) => {
|
|
2421
|
+
return $(node2.value).with(null, () => !(hint & JSXValueHint.SkipNullLiteral)).with(N.boolean, () => !(hint & JSXValueHint.SkipBooleanLiteral)).with(N.string, () => !(hint & JSXValueHint.SkipStringLiteral)).with(N.number, () => !(hint & JSXValueHint.SkipNumberLiteral)).otherwise(Function_exports.constFalse);
|
|
2422
|
+
}).with({ type: ast.NodeType.TemplateLiteral }, () => !(hint & JSXValueHint.SkipStringLiteral)).with({ type: ast.NodeType.ArrayExpression }, (node2) => {
|
|
2423
|
+
if (hint & JSXValueHint.StrictArray)
|
|
2424
|
+
return node2.elements.every((n2) => isJSXValue(n2, context, hint));
|
|
2425
|
+
return node2.elements.some((n2) => isJSXValue(n2, context, hint));
|
|
2426
|
+
}).with({ type: ast.NodeType.ConditionalExpression }, (node2) => {
|
|
2427
|
+
function leftHasJSX(node3) {
|
|
2428
|
+
if (Array.isArray(node3.consequent)) {
|
|
2429
|
+
if (hint & JSXValueHint.StrictArray) {
|
|
2430
|
+
return node3.consequent.every((n2) => isJSXValue(n2, context, hint));
|
|
2431
|
+
}
|
|
2432
|
+
return node3.consequent.some((n2) => isJSXValue(n2, context, hint));
|
|
2433
|
+
}
|
|
2434
|
+
return isJSXValue(node3.consequent, context, hint);
|
|
2435
|
+
}
|
|
2436
|
+
function rightHasJSX(node3) {
|
|
2437
|
+
return isJSXValue(node3.alternate, context, hint);
|
|
2438
|
+
}
|
|
2439
|
+
if (hint & JSXValueHint.StrictConditional) {
|
|
2440
|
+
return leftHasJSX(node2) && rightHasJSX(node2);
|
|
2441
|
+
}
|
|
2442
|
+
return leftHasJSX(node2) || rightHasJSX(node2);
|
|
2443
|
+
}).with({ type: ast.NodeType.LogicalExpression }, (node2) => {
|
|
2444
|
+
return isJSXValue(node2.left, context, hint) || isJSXValue(node2.right, context, hint);
|
|
2445
|
+
}).with({ type: ast.NodeType.SequenceExpression }, (node2) => {
|
|
2446
|
+
const exp = node2.expressions.at(-1);
|
|
2447
|
+
return isJSXValue(exp, context, hint);
|
|
2448
|
+
}).with({ type: ast.NodeType.CallExpression }, (node2) => {
|
|
2449
|
+
if (hint & JSXValueHint.SkipCreateElement)
|
|
2450
|
+
return false;
|
|
2451
|
+
return $(node2.callee).with({ type: ast.NodeType.Identifier, name: "createElement" }, Function_exports.constTrue).with({ type: ast.NodeType.MemberExpression, property: { name: "createElement" } }, Function_exports.constTrue).otherwise(Function_exports.constFalse);
|
|
2452
|
+
}).with({ type: ast.NodeType.Identifier }, (node2) => {
|
|
2453
|
+
const { name } = node2;
|
|
2454
|
+
if (name === "undefined")
|
|
2455
|
+
return !(hint & JSXValueHint.SkipUndefinedLiteral);
|
|
2456
|
+
if (ast.isJSXTagNameExpression(node2))
|
|
2457
|
+
return true;
|
|
2458
|
+
const initialScope = context.sourceCode.getScope(node2);
|
|
2459
|
+
const maybeVariable = _var.findVariable(name, initialScope);
|
|
2460
|
+
return Function_exports.pipe(
|
|
2461
|
+
maybeVariable,
|
|
2462
|
+
Option_exports.flatMap(_var.getVariableInit(0)),
|
|
2463
|
+
Option_exports.exists((n2) => isJSXValue(n2, context, hint))
|
|
2464
|
+
);
|
|
2465
|
+
}).otherwise(Function_exports.constFalse);
|
|
2466
|
+
}
|
|
1836
2467
|
|
|
1837
2468
|
exports.DEFAULT_JSX_VALUE_HINT = DEFAULT_JSX_VALUE_HINT;
|
|
1838
2469
|
exports.JSXValueHint = JSXValueHint;
|
|
1839
2470
|
exports.elementType = elementType;
|
|
1840
2471
|
exports.findPropInAttributes = findPropInAttributes;
|
|
1841
2472
|
exports.findPropInProperties = findPropInProperties;
|
|
1842
|
-
exports.
|
|
1843
|
-
exports.getPragmaFromContext = getPragmaFromContext;
|
|
2473
|
+
exports.getJSXPragmaFromContext = getJSXPragmaFromContext;
|
|
1844
2474
|
exports.getProp = getProp;
|
|
1845
2475
|
exports.getPropName = getPropName;
|
|
1846
2476
|
exports.getPropValue = getPropValue;
|
|
1847
2477
|
exports.hasAnyProp = hasAnyProp;
|
|
1848
|
-
exports.hasChildren = hasChildren;
|
|
1849
2478
|
exports.hasEveryProp = hasEveryProp;
|
|
1850
2479
|
exports.hasProp = hasProp;
|
|
1851
|
-
exports.isCallFromPragma = isCallFromPragma;
|
|
1852
|
-
exports.isCallFromPragmaMember = isCallFromPragmaMember;
|
|
1853
|
-
exports.isChildOfJSXElement = isChildOfJSXElement;
|
|
1854
|
-
exports.isChildrenOfCreateElement = isChildrenOfCreateElement;
|
|
1855
|
-
exports.isCloneElement = isCloneElement;
|
|
1856
|
-
exports.isCloneElementCall = isCloneElementCall;
|
|
1857
|
-
exports.isCreateElement = isCreateElement;
|
|
1858
|
-
exports.isCreateElementCall = isCreateElementCall;
|
|
1859
|
-
exports.isFragment = isFragment;
|
|
1860
|
-
exports.isFragmentElement = isFragmentElement;
|
|
1861
|
-
exports.isFragmentSyntax = isFragmentSyntax;
|
|
1862
|
-
exports.isFromPragma = isFromPragma;
|
|
1863
|
-
exports.isFromPragmaMember = isFromPragmaMember;
|
|
1864
|
-
exports.isFunctionReturningJSXValue = isFunctionReturningJSXValue;
|
|
1865
|
-
exports.isInitializedFromPragma = isInitializedFromPragma;
|
|
1866
|
-
exports.isInsideCreateElementProps = isInsideCreateElementProps;
|
|
1867
2480
|
exports.isInsidePropValue = isInsidePropValue;
|
|
1868
2481
|
exports.isJSXElementOfBuiltinComponent = isJSXElementOfBuiltinComponent;
|
|
1869
2482
|
exports.isJSXElementOfUserDefinedComponent = isJSXElementOfUserDefinedComponent;
|
|
@@ -1871,6 +2484,5 @@ exports.isJSXValue = isJSXValue;
|
|
|
1871
2484
|
exports.isLineBreak = isLineBreak;
|
|
1872
2485
|
exports.isLiteral = isLiteral;
|
|
1873
2486
|
exports.isPaddingSpaces = isPaddingSpaces;
|
|
1874
|
-
exports.isPropertyOfPragma = isPropertyOfPragma;
|
|
1875
2487
|
exports.isWhiteSpace = isWhiteSpace;
|
|
1876
2488
|
exports.traverseUpProp = traverseUpProp;
|