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