eslint-plugin-react-hooks-extra 1.5.20 → 1.5.21-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +30 -1144
- package/dist/index.mjs +30 -1144
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -4,16 +4,12 @@ var core = require('@eslint-react/core');
|
|
|
4
4
|
var shared = require('@eslint-react/shared');
|
|
5
5
|
var ast = require('@eslint-react/ast');
|
|
6
6
|
var _var = require('@eslint-react/var');
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
var __export = (target, all2) => {
|
|
10
|
-
for (var name2 in all2)
|
|
11
|
-
__defProp(target, name2, { get: all2[name2], enumerable: true });
|
|
12
|
-
};
|
|
7
|
+
var effect = require('effect');
|
|
8
|
+
var tsPattern = require('ts-pattern');
|
|
13
9
|
|
|
14
10
|
// package.json
|
|
15
11
|
var name = "eslint-plugin-react-hooks-extra";
|
|
16
|
-
var version = "1.5.
|
|
12
|
+
var version = "1.5.21-next.0";
|
|
17
13
|
var createRule = shared.createRuleForPlugin("hooks-extra");
|
|
18
14
|
|
|
19
15
|
// src/rules/ensure-custom-hooks-using-other-hooks.ts
|
|
@@ -52,1116 +48,6 @@ var ensure_custom_hooks_using_other_hooks_default = createRule({
|
|
|
52
48
|
},
|
|
53
49
|
defaultOptions: []
|
|
54
50
|
});
|
|
55
|
-
|
|
56
|
-
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Function.js
|
|
57
|
-
var Function_exports = {};
|
|
58
|
-
__export(Function_exports, {
|
|
59
|
-
SK: () => SK,
|
|
60
|
-
absurd: () => absurd,
|
|
61
|
-
apply: () => apply,
|
|
62
|
-
compose: () => compose,
|
|
63
|
-
constFalse: () => constFalse,
|
|
64
|
-
constNull: () => constNull,
|
|
65
|
-
constTrue: () => constTrue,
|
|
66
|
-
constUndefined: () => constUndefined,
|
|
67
|
-
constVoid: () => constVoid,
|
|
68
|
-
constant: () => constant,
|
|
69
|
-
dual: () => dual,
|
|
70
|
-
flip: () => flip,
|
|
71
|
-
flow: () => flow,
|
|
72
|
-
hole: () => hole,
|
|
73
|
-
identity: () => identity,
|
|
74
|
-
isFunction: () => isFunction,
|
|
75
|
-
pipe: () => pipe,
|
|
76
|
-
satisfies: () => satisfies,
|
|
77
|
-
tupled: () => tupled,
|
|
78
|
-
unsafeCoerce: () => unsafeCoerce,
|
|
79
|
-
untupled: () => untupled
|
|
80
|
-
});
|
|
81
|
-
var isFunction = (input) => typeof input === "function";
|
|
82
|
-
var dual = function(arity, body) {
|
|
83
|
-
if (typeof arity === "function") {
|
|
84
|
-
return function() {
|
|
85
|
-
if (arity(arguments)) {
|
|
86
|
-
return body.apply(this, arguments);
|
|
87
|
-
}
|
|
88
|
-
return (self) => body(self, ...arguments);
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
switch (arity) {
|
|
92
|
-
case 0:
|
|
93
|
-
case 1:
|
|
94
|
-
throw new RangeError(`Invalid arity ${arity}`);
|
|
95
|
-
case 2:
|
|
96
|
-
return function(a, b2) {
|
|
97
|
-
if (arguments.length >= 2) {
|
|
98
|
-
return body(a, b2);
|
|
99
|
-
}
|
|
100
|
-
return function(self) {
|
|
101
|
-
return body(self, a);
|
|
102
|
-
};
|
|
103
|
-
};
|
|
104
|
-
case 3:
|
|
105
|
-
return function(a, b2, c2) {
|
|
106
|
-
if (arguments.length >= 3) {
|
|
107
|
-
return body(a, b2, c2);
|
|
108
|
-
}
|
|
109
|
-
return function(self) {
|
|
110
|
-
return body(self, a, b2);
|
|
111
|
-
};
|
|
112
|
-
};
|
|
113
|
-
case 4:
|
|
114
|
-
return function(a, b2, c2, d2) {
|
|
115
|
-
if (arguments.length >= 4) {
|
|
116
|
-
return body(a, b2, c2, d2);
|
|
117
|
-
}
|
|
118
|
-
return function(self) {
|
|
119
|
-
return body(self, a, b2, c2);
|
|
120
|
-
};
|
|
121
|
-
};
|
|
122
|
-
case 5:
|
|
123
|
-
return function(a, b2, c2, d2, e2) {
|
|
124
|
-
if (arguments.length >= 5) {
|
|
125
|
-
return body(a, b2, c2, d2, e2);
|
|
126
|
-
}
|
|
127
|
-
return function(self) {
|
|
128
|
-
return body(self, a, b2, c2, d2);
|
|
129
|
-
};
|
|
130
|
-
};
|
|
131
|
-
default:
|
|
132
|
-
return function() {
|
|
133
|
-
if (arguments.length >= arity) {
|
|
134
|
-
return body.apply(this, arguments);
|
|
135
|
-
}
|
|
136
|
-
const args = arguments;
|
|
137
|
-
return function(self) {
|
|
138
|
-
return body(self, ...args);
|
|
139
|
-
};
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
};
|
|
143
|
-
var apply = (a) => (self) => self(a);
|
|
144
|
-
var identity = (a) => a;
|
|
145
|
-
var satisfies = () => (b2) => b2;
|
|
146
|
-
var unsafeCoerce = identity;
|
|
147
|
-
var constant = (value) => () => value;
|
|
148
|
-
var constTrue = /* @__PURE__ */ constant(true);
|
|
149
|
-
var constFalse = /* @__PURE__ */ constant(false);
|
|
150
|
-
var constNull = /* @__PURE__ */ constant(null);
|
|
151
|
-
var constUndefined = /* @__PURE__ */ constant(void 0);
|
|
152
|
-
var constVoid = constUndefined;
|
|
153
|
-
var flip = (f) => (...b2) => (...a) => f(...a)(...b2);
|
|
154
|
-
var compose = /* @__PURE__ */ dual(2, (ab, bc) => (a) => bc(ab(a)));
|
|
155
|
-
var absurd = (_2) => {
|
|
156
|
-
throw new Error("Called `absurd` function which should be uncallable");
|
|
157
|
-
};
|
|
158
|
-
var tupled = (f) => (a) => f(...a);
|
|
159
|
-
var untupled = (f) => (...a) => f(a);
|
|
160
|
-
function pipe(a, ab, bc, cd, de, ef, fg, gh, hi) {
|
|
161
|
-
switch (arguments.length) {
|
|
162
|
-
case 1:
|
|
163
|
-
return a;
|
|
164
|
-
case 2:
|
|
165
|
-
return ab(a);
|
|
166
|
-
case 3:
|
|
167
|
-
return bc(ab(a));
|
|
168
|
-
case 4:
|
|
169
|
-
return cd(bc(ab(a)));
|
|
170
|
-
case 5:
|
|
171
|
-
return de(cd(bc(ab(a))));
|
|
172
|
-
case 6:
|
|
173
|
-
return ef(de(cd(bc(ab(a)))));
|
|
174
|
-
case 7:
|
|
175
|
-
return fg(ef(de(cd(bc(ab(a))))));
|
|
176
|
-
case 8:
|
|
177
|
-
return gh(fg(ef(de(cd(bc(ab(a)))))));
|
|
178
|
-
case 9:
|
|
179
|
-
return hi(gh(fg(ef(de(cd(bc(ab(a))))))));
|
|
180
|
-
default: {
|
|
181
|
-
let ret = arguments[0];
|
|
182
|
-
for (let i2 = 1; i2 < arguments.length; i2++) {
|
|
183
|
-
ret = arguments[i2](ret);
|
|
184
|
-
}
|
|
185
|
-
return ret;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
function flow(ab, bc, cd, de, ef, fg, gh, hi, ij) {
|
|
190
|
-
switch (arguments.length) {
|
|
191
|
-
case 1:
|
|
192
|
-
return ab;
|
|
193
|
-
case 2:
|
|
194
|
-
return function() {
|
|
195
|
-
return bc(ab.apply(this, arguments));
|
|
196
|
-
};
|
|
197
|
-
case 3:
|
|
198
|
-
return function() {
|
|
199
|
-
return cd(bc(ab.apply(this, arguments)));
|
|
200
|
-
};
|
|
201
|
-
case 4:
|
|
202
|
-
return function() {
|
|
203
|
-
return de(cd(bc(ab.apply(this, arguments))));
|
|
204
|
-
};
|
|
205
|
-
case 5:
|
|
206
|
-
return function() {
|
|
207
|
-
return ef(de(cd(bc(ab.apply(this, arguments)))));
|
|
208
|
-
};
|
|
209
|
-
case 6:
|
|
210
|
-
return function() {
|
|
211
|
-
return fg(ef(de(cd(bc(ab.apply(this, arguments))))));
|
|
212
|
-
};
|
|
213
|
-
case 7:
|
|
214
|
-
return function() {
|
|
215
|
-
return gh(fg(ef(de(cd(bc(ab.apply(this, arguments)))))));
|
|
216
|
-
};
|
|
217
|
-
case 8:
|
|
218
|
-
return function() {
|
|
219
|
-
return hi(gh(fg(ef(de(cd(bc(ab.apply(this, arguments))))))));
|
|
220
|
-
};
|
|
221
|
-
case 9:
|
|
222
|
-
return function() {
|
|
223
|
-
return ij(hi(gh(fg(ef(de(cd(bc(ab.apply(this, arguments)))))))));
|
|
224
|
-
};
|
|
225
|
-
}
|
|
226
|
-
return;
|
|
227
|
-
}
|
|
228
|
-
var hole = /* @__PURE__ */ unsafeCoerce(absurd);
|
|
229
|
-
var SK = (_2, b2) => b2;
|
|
230
|
-
|
|
231
|
-
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Equivalence.js
|
|
232
|
-
var make = (isEquivalent) => (self, that) => self === that || isEquivalent(self, that);
|
|
233
|
-
|
|
234
|
-
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/internal/doNotation.js
|
|
235
|
-
var let_ = (map2) => dual(3, (self, name2, f) => map2(self, (a) => Object.assign({}, a, {
|
|
236
|
-
[name2]: f(a)
|
|
237
|
-
})));
|
|
238
|
-
var bindTo = (map2) => dual(2, (self, name2) => map2(self, (a) => ({
|
|
239
|
-
[name2]: a
|
|
240
|
-
})));
|
|
241
|
-
var bind = (map2, flatMap2) => dual(3, (self, name2, f) => flatMap2(self, (a) => map2(f(a), (b2) => Object.assign({}, a, {
|
|
242
|
-
[name2]: b2
|
|
243
|
-
}))));
|
|
244
|
-
|
|
245
|
-
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/internal/version.js
|
|
246
|
-
var moduleVersion = "3.4.6";
|
|
247
|
-
var getCurrentVersion = () => moduleVersion;
|
|
248
|
-
|
|
249
|
-
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/GlobalValue.js
|
|
250
|
-
var globalStoreId = /* @__PURE__ */ Symbol.for(`effect/GlobalValue/globalStoreId/${/* @__PURE__ */ getCurrentVersion()}`);
|
|
251
|
-
if (!(globalStoreId in globalThis)) {
|
|
252
|
-
globalThis[globalStoreId] = /* @__PURE__ */ new Map();
|
|
253
|
-
}
|
|
254
|
-
var globalStore = globalThis[globalStoreId];
|
|
255
|
-
var globalValue = (id, compute) => {
|
|
256
|
-
if (!globalStore.has(id)) {
|
|
257
|
-
globalStore.set(id, compute());
|
|
258
|
-
}
|
|
259
|
-
return globalStore.get(id);
|
|
260
|
-
};
|
|
261
|
-
|
|
262
|
-
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Predicate.js
|
|
263
|
-
var isFunction2 = isFunction;
|
|
264
|
-
var isRecordOrArray = (input) => typeof input === "object" && input !== null;
|
|
265
|
-
var isObject = (input) => isRecordOrArray(input) || isFunction2(input);
|
|
266
|
-
var hasProperty = /* @__PURE__ */ dual(2, (self, property) => isObject(self) && property in self);
|
|
267
|
-
|
|
268
|
-
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/internal/errors.js
|
|
269
|
-
var getBugErrorMessage = (message) => `BUG: ${message} - please report an issue at https://github.com/Effect-TS/effect/issues`;
|
|
270
|
-
|
|
271
|
-
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Utils.js
|
|
272
|
-
var GenKindTypeId = /* @__PURE__ */ Symbol.for("effect/Gen/GenKind");
|
|
273
|
-
var isGenKind = (u2) => isObject(u2) && GenKindTypeId in u2;
|
|
274
|
-
var GenKindImpl = class {
|
|
275
|
-
value;
|
|
276
|
-
constructor(value) {
|
|
277
|
-
this.value = value;
|
|
278
|
-
}
|
|
279
|
-
/**
|
|
280
|
-
* @since 2.0.0
|
|
281
|
-
*/
|
|
282
|
-
get _F() {
|
|
283
|
-
return identity;
|
|
284
|
-
}
|
|
285
|
-
/**
|
|
286
|
-
* @since 2.0.0
|
|
287
|
-
*/
|
|
288
|
-
get _R() {
|
|
289
|
-
return (_2) => _2;
|
|
290
|
-
}
|
|
291
|
-
/**
|
|
292
|
-
* @since 2.0.0
|
|
293
|
-
*/
|
|
294
|
-
get _O() {
|
|
295
|
-
return (_2) => _2;
|
|
296
|
-
}
|
|
297
|
-
/**
|
|
298
|
-
* @since 2.0.0
|
|
299
|
-
*/
|
|
300
|
-
get _E() {
|
|
301
|
-
return (_2) => _2;
|
|
302
|
-
}
|
|
303
|
-
/**
|
|
304
|
-
* @since 2.0.0
|
|
305
|
-
*/
|
|
306
|
-
[GenKindTypeId] = GenKindTypeId;
|
|
307
|
-
/**
|
|
308
|
-
* @since 2.0.0
|
|
309
|
-
*/
|
|
310
|
-
[Symbol.iterator]() {
|
|
311
|
-
return new SingleShotGen(this);
|
|
312
|
-
}
|
|
313
|
-
};
|
|
314
|
-
var SingleShotGen = class _SingleShotGen {
|
|
315
|
-
self;
|
|
316
|
-
called = false;
|
|
317
|
-
constructor(self) {
|
|
318
|
-
this.self = self;
|
|
319
|
-
}
|
|
320
|
-
/**
|
|
321
|
-
* @since 2.0.0
|
|
322
|
-
*/
|
|
323
|
-
next(a) {
|
|
324
|
-
return this.called ? {
|
|
325
|
-
value: a,
|
|
326
|
-
done: true
|
|
327
|
-
} : (this.called = true, {
|
|
328
|
-
value: this.self,
|
|
329
|
-
done: false
|
|
330
|
-
});
|
|
331
|
-
}
|
|
332
|
-
/**
|
|
333
|
-
* @since 2.0.0
|
|
334
|
-
*/
|
|
335
|
-
return(a) {
|
|
336
|
-
return {
|
|
337
|
-
value: a,
|
|
338
|
-
done: true
|
|
339
|
-
};
|
|
340
|
-
}
|
|
341
|
-
/**
|
|
342
|
-
* @since 2.0.0
|
|
343
|
-
*/
|
|
344
|
-
throw(e2) {
|
|
345
|
-
throw e2;
|
|
346
|
-
}
|
|
347
|
-
/**
|
|
348
|
-
* @since 2.0.0
|
|
349
|
-
*/
|
|
350
|
-
[Symbol.iterator]() {
|
|
351
|
-
return new _SingleShotGen(this.self);
|
|
352
|
-
}
|
|
353
|
-
};
|
|
354
|
-
var adapter = () => function() {
|
|
355
|
-
let x2 = arguments[0];
|
|
356
|
-
for (let i2 = 1; i2 < arguments.length; i2++) {
|
|
357
|
-
x2 = arguments[i2](x2);
|
|
358
|
-
}
|
|
359
|
-
return new GenKindImpl(x2);
|
|
360
|
-
};
|
|
361
|
-
var YieldWrapTypeId = /* @__PURE__ */ Symbol.for("effect/Utils/YieldWrap");
|
|
362
|
-
var YieldWrap = class {
|
|
363
|
-
/**
|
|
364
|
-
* @since 3.0.6
|
|
365
|
-
*/
|
|
366
|
-
#value;
|
|
367
|
-
constructor(value) {
|
|
368
|
-
this.#value = value;
|
|
369
|
-
}
|
|
370
|
-
/**
|
|
371
|
-
* @since 3.0.6
|
|
372
|
-
*/
|
|
373
|
-
[YieldWrapTypeId]() {
|
|
374
|
-
return this.#value;
|
|
375
|
-
}
|
|
376
|
-
};
|
|
377
|
-
function yieldWrapGet(self) {
|
|
378
|
-
if (typeof self === "object" && self !== null && YieldWrapTypeId in self) {
|
|
379
|
-
return self[YieldWrapTypeId]();
|
|
380
|
-
}
|
|
381
|
-
throw new Error(getBugErrorMessage("yieldWrapGet"));
|
|
382
|
-
}
|
|
383
|
-
var structuralRegionState = /* @__PURE__ */ globalValue("effect/Utils/isStructuralRegion", () => ({
|
|
384
|
-
enabled: false,
|
|
385
|
-
tester: void 0
|
|
386
|
-
}));
|
|
387
|
-
|
|
388
|
-
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Hash.js
|
|
389
|
-
var randomHashCache = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("effect/Hash/randomHashCache"), () => /* @__PURE__ */ new WeakMap());
|
|
390
|
-
var symbol = /* @__PURE__ */ Symbol.for("effect/Hash");
|
|
391
|
-
var hash = (self) => {
|
|
392
|
-
if (structuralRegionState.enabled === true) {
|
|
393
|
-
return 0;
|
|
394
|
-
}
|
|
395
|
-
switch (typeof self) {
|
|
396
|
-
case "number":
|
|
397
|
-
return number(self);
|
|
398
|
-
case "bigint":
|
|
399
|
-
return string(self.toString(10));
|
|
400
|
-
case "boolean":
|
|
401
|
-
return string(String(self));
|
|
402
|
-
case "symbol":
|
|
403
|
-
return string(String(self));
|
|
404
|
-
case "string":
|
|
405
|
-
return string(self);
|
|
406
|
-
case "undefined":
|
|
407
|
-
return string("undefined");
|
|
408
|
-
case "function":
|
|
409
|
-
case "object": {
|
|
410
|
-
if (self === null) {
|
|
411
|
-
return string("null");
|
|
412
|
-
} else if (self instanceof Date) {
|
|
413
|
-
return hash(self.toISOString());
|
|
414
|
-
} else if (isHash(self)) {
|
|
415
|
-
return self[symbol]();
|
|
416
|
-
} else {
|
|
417
|
-
return random(self);
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
default:
|
|
421
|
-
throw new Error(`BUG: unhandled typeof ${typeof self} - please report an issue at https://github.com/Effect-TS/effect/issues`);
|
|
422
|
-
}
|
|
423
|
-
};
|
|
424
|
-
var random = (self) => {
|
|
425
|
-
if (!randomHashCache.has(self)) {
|
|
426
|
-
randomHashCache.set(self, number(Math.floor(Math.random() * Number.MAX_SAFE_INTEGER)));
|
|
427
|
-
}
|
|
428
|
-
return randomHashCache.get(self);
|
|
429
|
-
};
|
|
430
|
-
var combine = (b2) => (self) => self * 53 ^ b2;
|
|
431
|
-
var optimize = (n2) => n2 & 3221225471 | n2 >>> 1 & 1073741824;
|
|
432
|
-
var isHash = (u2) => hasProperty(u2, symbol);
|
|
433
|
-
var number = (n2) => {
|
|
434
|
-
if (n2 !== n2 || n2 === Infinity) {
|
|
435
|
-
return 0;
|
|
436
|
-
}
|
|
437
|
-
let h = n2 | 0;
|
|
438
|
-
if (h !== n2) {
|
|
439
|
-
h ^= n2 * 4294967295;
|
|
440
|
-
}
|
|
441
|
-
while (n2 > 4294967295) {
|
|
442
|
-
h ^= n2 /= 4294967295;
|
|
443
|
-
}
|
|
444
|
-
return optimize(n2);
|
|
445
|
-
};
|
|
446
|
-
var string = (str) => {
|
|
447
|
-
let h = 5381, i2 = str.length;
|
|
448
|
-
while (i2) {
|
|
449
|
-
h = h * 33 ^ str.charCodeAt(--i2);
|
|
450
|
-
}
|
|
451
|
-
return optimize(h);
|
|
452
|
-
};
|
|
453
|
-
var cached = function() {
|
|
454
|
-
if (arguments.length === 1) {
|
|
455
|
-
const self2 = arguments[0];
|
|
456
|
-
return function(hash3) {
|
|
457
|
-
Object.defineProperty(self2, symbol, {
|
|
458
|
-
value() {
|
|
459
|
-
return hash3;
|
|
460
|
-
},
|
|
461
|
-
enumerable: false
|
|
462
|
-
});
|
|
463
|
-
return hash3;
|
|
464
|
-
};
|
|
465
|
-
}
|
|
466
|
-
const self = arguments[0];
|
|
467
|
-
const hash2 = arguments[1];
|
|
468
|
-
Object.defineProperty(self, symbol, {
|
|
469
|
-
value() {
|
|
470
|
-
return hash2;
|
|
471
|
-
},
|
|
472
|
-
enumerable: false
|
|
473
|
-
});
|
|
474
|
-
return hash2;
|
|
475
|
-
};
|
|
476
|
-
|
|
477
|
-
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Equal.js
|
|
478
|
-
var symbol2 = /* @__PURE__ */ Symbol.for("effect/Equal");
|
|
479
|
-
function equals() {
|
|
480
|
-
if (arguments.length === 1) {
|
|
481
|
-
return (self) => compareBoth(self, arguments[0]);
|
|
482
|
-
}
|
|
483
|
-
return compareBoth(arguments[0], arguments[1]);
|
|
484
|
-
}
|
|
485
|
-
function compareBoth(self, that) {
|
|
486
|
-
if (self === that) {
|
|
487
|
-
return true;
|
|
488
|
-
}
|
|
489
|
-
const selfType = typeof self;
|
|
490
|
-
if (selfType !== typeof that) {
|
|
491
|
-
return false;
|
|
492
|
-
}
|
|
493
|
-
if (selfType === "object" || selfType === "function") {
|
|
494
|
-
if (self !== null && that !== null) {
|
|
495
|
-
if (isEqual(self) && isEqual(that)) {
|
|
496
|
-
if (hash(self) === hash(that) && self[symbol2](that)) {
|
|
497
|
-
return true;
|
|
498
|
-
} else {
|
|
499
|
-
return structuralRegionState.enabled && structuralRegionState.tester ? structuralRegionState.tester(self, that) : false;
|
|
500
|
-
}
|
|
501
|
-
} else if (self instanceof Date && that instanceof Date) {
|
|
502
|
-
return self.toISOString() === that.toISOString();
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
if (structuralRegionState.enabled) {
|
|
506
|
-
if (Array.isArray(self) && Array.isArray(that)) {
|
|
507
|
-
return self.length === that.length && self.every((v2, i2) => compareBoth(v2, that[i2]));
|
|
508
|
-
}
|
|
509
|
-
if (Object.getPrototypeOf(self) === Object.prototype && Object.getPrototypeOf(self) === Object.prototype) {
|
|
510
|
-
const keysSelf = Object.keys(self);
|
|
511
|
-
const keysThat = Object.keys(that);
|
|
512
|
-
if (keysSelf.length === keysThat.length) {
|
|
513
|
-
for (const key of keysSelf) {
|
|
514
|
-
if (!(key in that && compareBoth(self[key], that[key]))) {
|
|
515
|
-
return structuralRegionState.tester ? structuralRegionState.tester(self, that) : false;
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
|
-
return true;
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
|
-
return structuralRegionState.tester ? structuralRegionState.tester(self, that) : false;
|
|
522
|
-
}
|
|
523
|
-
}
|
|
524
|
-
return structuralRegionState.enabled && structuralRegionState.tester ? structuralRegionState.tester(self, that) : false;
|
|
525
|
-
}
|
|
526
|
-
var isEqual = (u2) => hasProperty(u2, symbol2);
|
|
527
|
-
var equivalence = () => equals;
|
|
528
|
-
|
|
529
|
-
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Inspectable.js
|
|
530
|
-
var NodeInspectSymbol = /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom");
|
|
531
|
-
var toJSON = (x2) => {
|
|
532
|
-
if (hasProperty(x2, "toJSON") && isFunction2(x2["toJSON"]) && x2["toJSON"].length === 0) {
|
|
533
|
-
return x2.toJSON();
|
|
534
|
-
} else if (Array.isArray(x2)) {
|
|
535
|
-
return x2.map(toJSON);
|
|
536
|
-
}
|
|
537
|
-
return x2;
|
|
538
|
-
};
|
|
539
|
-
var format = (x2) => JSON.stringify(x2, null, 2);
|
|
540
|
-
|
|
541
|
-
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Pipeable.js
|
|
542
|
-
var pipeArguments = (self, args) => {
|
|
543
|
-
switch (args.length) {
|
|
544
|
-
case 1:
|
|
545
|
-
return args[0](self);
|
|
546
|
-
case 2:
|
|
547
|
-
return args[1](args[0](self));
|
|
548
|
-
case 3:
|
|
549
|
-
return args[2](args[1](args[0](self)));
|
|
550
|
-
case 4:
|
|
551
|
-
return args[3](args[2](args[1](args[0](self))));
|
|
552
|
-
case 5:
|
|
553
|
-
return args[4](args[3](args[2](args[1](args[0](self)))));
|
|
554
|
-
case 6:
|
|
555
|
-
return args[5](args[4](args[3](args[2](args[1](args[0](self))))));
|
|
556
|
-
case 7:
|
|
557
|
-
return args[6](args[5](args[4](args[3](args[2](args[1](args[0](self)))))));
|
|
558
|
-
case 8:
|
|
559
|
-
return args[7](args[6](args[5](args[4](args[3](args[2](args[1](args[0](self))))))));
|
|
560
|
-
case 9:
|
|
561
|
-
return args[8](args[7](args[6](args[5](args[4](args[3](args[2](args[1](args[0](self)))))))));
|
|
562
|
-
default: {
|
|
563
|
-
let ret = self;
|
|
564
|
-
for (let i2 = 0, len = args.length; i2 < len; i2++) {
|
|
565
|
-
ret = args[i2](ret);
|
|
566
|
-
}
|
|
567
|
-
return ret;
|
|
568
|
-
}
|
|
569
|
-
}
|
|
570
|
-
};
|
|
571
|
-
|
|
572
|
-
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/internal/effectable.js
|
|
573
|
-
var EffectTypeId = /* @__PURE__ */ Symbol.for("effect/Effect");
|
|
574
|
-
var StreamTypeId = /* @__PURE__ */ Symbol.for("effect/Stream");
|
|
575
|
-
var SinkTypeId = /* @__PURE__ */ Symbol.for("effect/Sink");
|
|
576
|
-
var ChannelTypeId = /* @__PURE__ */ Symbol.for("effect/Channel");
|
|
577
|
-
var effectVariance = {
|
|
578
|
-
/* c8 ignore next */
|
|
579
|
-
_R: (_2) => _2,
|
|
580
|
-
/* c8 ignore next */
|
|
581
|
-
_E: (_2) => _2,
|
|
582
|
-
/* c8 ignore next */
|
|
583
|
-
_A: (_2) => _2,
|
|
584
|
-
_V: /* @__PURE__ */ getCurrentVersion()
|
|
585
|
-
};
|
|
586
|
-
var sinkVariance = {
|
|
587
|
-
/* c8 ignore next */
|
|
588
|
-
_A: (_2) => _2,
|
|
589
|
-
/* c8 ignore next */
|
|
590
|
-
_In: (_2) => _2,
|
|
591
|
-
/* c8 ignore next */
|
|
592
|
-
_L: (_2) => _2,
|
|
593
|
-
/* c8 ignore next */
|
|
594
|
-
_E: (_2) => _2,
|
|
595
|
-
/* c8 ignore next */
|
|
596
|
-
_R: (_2) => _2
|
|
597
|
-
};
|
|
598
|
-
var channelVariance = {
|
|
599
|
-
/* c8 ignore next */
|
|
600
|
-
_Env: (_2) => _2,
|
|
601
|
-
/* c8 ignore next */
|
|
602
|
-
_InErr: (_2) => _2,
|
|
603
|
-
/* c8 ignore next */
|
|
604
|
-
_InElem: (_2) => _2,
|
|
605
|
-
/* c8 ignore next */
|
|
606
|
-
_InDone: (_2) => _2,
|
|
607
|
-
/* c8 ignore next */
|
|
608
|
-
_OutErr: (_2) => _2,
|
|
609
|
-
/* c8 ignore next */
|
|
610
|
-
_OutElem: (_2) => _2,
|
|
611
|
-
/* c8 ignore next */
|
|
612
|
-
_OutDone: (_2) => _2
|
|
613
|
-
};
|
|
614
|
-
var EffectPrototype = {
|
|
615
|
-
[EffectTypeId]: effectVariance,
|
|
616
|
-
[StreamTypeId]: effectVariance,
|
|
617
|
-
[SinkTypeId]: sinkVariance,
|
|
618
|
-
[ChannelTypeId]: channelVariance,
|
|
619
|
-
[symbol2](that) {
|
|
620
|
-
return this === that;
|
|
621
|
-
},
|
|
622
|
-
[symbol]() {
|
|
623
|
-
return cached(this, random(this));
|
|
624
|
-
},
|
|
625
|
-
[Symbol.iterator]() {
|
|
626
|
-
return new SingleShotGen(new YieldWrap(this));
|
|
627
|
-
},
|
|
628
|
-
pipe() {
|
|
629
|
-
return pipeArguments(this, arguments);
|
|
630
|
-
}
|
|
631
|
-
};
|
|
632
|
-
|
|
633
|
-
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/internal/option.js
|
|
634
|
-
var TypeId = /* @__PURE__ */ Symbol.for("effect/Option");
|
|
635
|
-
var CommonProto = {
|
|
636
|
-
...EffectPrototype,
|
|
637
|
-
[TypeId]: {
|
|
638
|
-
_A: (_2) => _2
|
|
639
|
-
},
|
|
640
|
-
[NodeInspectSymbol]() {
|
|
641
|
-
return this.toJSON();
|
|
642
|
-
},
|
|
643
|
-
toString() {
|
|
644
|
-
return format(this.toJSON());
|
|
645
|
-
}
|
|
646
|
-
};
|
|
647
|
-
var SomeProto = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(CommonProto), {
|
|
648
|
-
_tag: "Some",
|
|
649
|
-
_op: "Some",
|
|
650
|
-
[symbol2](that) {
|
|
651
|
-
return isOption(that) && isSome(that) && equals(this.value, that.value);
|
|
652
|
-
},
|
|
653
|
-
[symbol]() {
|
|
654
|
-
return cached(this, combine(hash(this._tag))(hash(this.value)));
|
|
655
|
-
},
|
|
656
|
-
toJSON() {
|
|
657
|
-
return {
|
|
658
|
-
_id: "Option",
|
|
659
|
-
_tag: this._tag,
|
|
660
|
-
value: toJSON(this.value)
|
|
661
|
-
};
|
|
662
|
-
}
|
|
663
|
-
});
|
|
664
|
-
var NoneHash = /* @__PURE__ */ hash("None");
|
|
665
|
-
var NoneProto = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(CommonProto), {
|
|
666
|
-
_tag: "None",
|
|
667
|
-
_op: "None",
|
|
668
|
-
[symbol2](that) {
|
|
669
|
-
return isOption(that) && isNone(that);
|
|
670
|
-
},
|
|
671
|
-
[symbol]() {
|
|
672
|
-
return NoneHash;
|
|
673
|
-
},
|
|
674
|
-
toJSON() {
|
|
675
|
-
return {
|
|
676
|
-
_id: "Option",
|
|
677
|
-
_tag: this._tag
|
|
678
|
-
};
|
|
679
|
-
}
|
|
680
|
-
});
|
|
681
|
-
var isOption = (input) => hasProperty(input, TypeId);
|
|
682
|
-
var isNone = (fa) => fa._tag === "None";
|
|
683
|
-
var isSome = (fa) => fa._tag === "Some";
|
|
684
|
-
var none = /* @__PURE__ */ Object.create(NoneProto);
|
|
685
|
-
var some = (value) => {
|
|
686
|
-
const a = Object.create(SomeProto);
|
|
687
|
-
a.value = value;
|
|
688
|
-
return a;
|
|
689
|
-
};
|
|
690
|
-
|
|
691
|
-
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/internal/either.js
|
|
692
|
-
var TypeId2 = /* @__PURE__ */ Symbol.for("effect/Either");
|
|
693
|
-
var CommonProto2 = {
|
|
694
|
-
...EffectPrototype,
|
|
695
|
-
[TypeId2]: {
|
|
696
|
-
_R: (_2) => _2
|
|
697
|
-
},
|
|
698
|
-
[NodeInspectSymbol]() {
|
|
699
|
-
return this.toJSON();
|
|
700
|
-
},
|
|
701
|
-
toString() {
|
|
702
|
-
return format(this.toJSON());
|
|
703
|
-
}
|
|
704
|
-
};
|
|
705
|
-
var RightProto = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(CommonProto2), {
|
|
706
|
-
_tag: "Right",
|
|
707
|
-
_op: "Right",
|
|
708
|
-
[symbol2](that) {
|
|
709
|
-
return isEither(that) && isRight(that) && equals(this.right, that.right);
|
|
710
|
-
},
|
|
711
|
-
[symbol]() {
|
|
712
|
-
return combine(hash(this._tag))(hash(this.right));
|
|
713
|
-
},
|
|
714
|
-
toJSON() {
|
|
715
|
-
return {
|
|
716
|
-
_id: "Either",
|
|
717
|
-
_tag: this._tag,
|
|
718
|
-
right: toJSON(this.right)
|
|
719
|
-
};
|
|
720
|
-
}
|
|
721
|
-
});
|
|
722
|
-
var LeftProto = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(CommonProto2), {
|
|
723
|
-
_tag: "Left",
|
|
724
|
-
_op: "Left",
|
|
725
|
-
[symbol2](that) {
|
|
726
|
-
return isEither(that) && isLeft(that) && equals(this.left, that.left);
|
|
727
|
-
},
|
|
728
|
-
[symbol]() {
|
|
729
|
-
return combine(hash(this._tag))(hash(this.left));
|
|
730
|
-
},
|
|
731
|
-
toJSON() {
|
|
732
|
-
return {
|
|
733
|
-
_id: "Either",
|
|
734
|
-
_tag: this._tag,
|
|
735
|
-
left: toJSON(this.left)
|
|
736
|
-
};
|
|
737
|
-
}
|
|
738
|
-
});
|
|
739
|
-
var isEither = (input) => hasProperty(input, TypeId2);
|
|
740
|
-
var isLeft = (ma) => ma._tag === "Left";
|
|
741
|
-
var isRight = (ma) => ma._tag === "Right";
|
|
742
|
-
var left = (left2) => {
|
|
743
|
-
const a = Object.create(LeftProto);
|
|
744
|
-
a.left = left2;
|
|
745
|
-
return a;
|
|
746
|
-
};
|
|
747
|
-
var right = (right2) => {
|
|
748
|
-
const a = Object.create(RightProto);
|
|
749
|
-
a.right = right2;
|
|
750
|
-
return a;
|
|
751
|
-
};
|
|
752
|
-
var getLeft = (self) => isRight(self) ? none : some(self.left);
|
|
753
|
-
var getRight = (self) => isLeft(self) ? none : some(self.right);
|
|
754
|
-
|
|
755
|
-
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Option.js
|
|
756
|
-
var Option_exports = {};
|
|
757
|
-
__export(Option_exports, {
|
|
758
|
-
Do: () => Do,
|
|
759
|
-
TypeId: () => TypeId3,
|
|
760
|
-
all: () => all,
|
|
761
|
-
andThen: () => andThen,
|
|
762
|
-
ap: () => ap,
|
|
763
|
-
as: () => as,
|
|
764
|
-
asVoid: () => asVoid,
|
|
765
|
-
bind: () => bind2,
|
|
766
|
-
bindTo: () => bindTo2,
|
|
767
|
-
composeK: () => composeK,
|
|
768
|
-
contains: () => contains,
|
|
769
|
-
containsWith: () => containsWith,
|
|
770
|
-
exists: () => exists,
|
|
771
|
-
filter: () => filter,
|
|
772
|
-
filterMap: () => filterMap,
|
|
773
|
-
firstSomeOf: () => firstSomeOf,
|
|
774
|
-
flatMap: () => flatMap,
|
|
775
|
-
flatMapNullable: () => flatMapNullable,
|
|
776
|
-
flatten: () => flatten,
|
|
777
|
-
fromIterable: () => fromIterable,
|
|
778
|
-
fromNullable: () => fromNullable,
|
|
779
|
-
gen: () => gen,
|
|
780
|
-
getEquivalence: () => getEquivalence,
|
|
781
|
-
getLeft: () => getLeft2,
|
|
782
|
-
getOrElse: () => getOrElse,
|
|
783
|
-
getOrNull: () => getOrNull,
|
|
784
|
-
getOrThrow: () => getOrThrow,
|
|
785
|
-
getOrThrowWith: () => getOrThrowWith,
|
|
786
|
-
getOrUndefined: () => getOrUndefined,
|
|
787
|
-
getOrder: () => getOrder,
|
|
788
|
-
getRight: () => getRight2,
|
|
789
|
-
isNone: () => isNone2,
|
|
790
|
-
isOption: () => isOption2,
|
|
791
|
-
isSome: () => isSome2,
|
|
792
|
-
let: () => let_2,
|
|
793
|
-
lift2: () => lift2,
|
|
794
|
-
liftNullable: () => liftNullable,
|
|
795
|
-
liftPredicate: () => liftPredicate,
|
|
796
|
-
liftThrowable: () => liftThrowable,
|
|
797
|
-
map: () => map,
|
|
798
|
-
match: () => match,
|
|
799
|
-
none: () => none2,
|
|
800
|
-
orElse: () => orElse,
|
|
801
|
-
orElseEither: () => orElseEither,
|
|
802
|
-
orElseSome: () => orElseSome,
|
|
803
|
-
partitionMap: () => partitionMap,
|
|
804
|
-
product: () => product,
|
|
805
|
-
productMany: () => productMany,
|
|
806
|
-
reduceCompact: () => reduceCompact,
|
|
807
|
-
some: () => some2,
|
|
808
|
-
tap: () => tap,
|
|
809
|
-
toArray: () => toArray,
|
|
810
|
-
toRefinement: () => toRefinement,
|
|
811
|
-
void: () => void_,
|
|
812
|
-
zipLeft: () => zipLeft,
|
|
813
|
-
zipRight: () => zipRight,
|
|
814
|
-
zipWith: () => zipWith
|
|
815
|
-
});
|
|
816
|
-
|
|
817
|
-
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Order.js
|
|
818
|
-
var make2 = (compare) => (self, that) => self === that ? 0 : compare(self, that);
|
|
819
|
-
|
|
820
|
-
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Option.js
|
|
821
|
-
var TypeId3 = /* @__PURE__ */ Symbol.for("effect/Option");
|
|
822
|
-
var none2 = () => none;
|
|
823
|
-
var some2 = some;
|
|
824
|
-
var isOption2 = isOption;
|
|
825
|
-
var isNone2 = isNone;
|
|
826
|
-
var isSome2 = isSome;
|
|
827
|
-
var match = /* @__PURE__ */ dual(2, (self, {
|
|
828
|
-
onNone,
|
|
829
|
-
onSome
|
|
830
|
-
}) => isNone2(self) ? onNone() : onSome(self.value));
|
|
831
|
-
var toRefinement = (f) => (a) => isSome2(f(a));
|
|
832
|
-
var fromIterable = (collection) => {
|
|
833
|
-
for (const a of collection) {
|
|
834
|
-
return some2(a);
|
|
835
|
-
}
|
|
836
|
-
return none2();
|
|
837
|
-
};
|
|
838
|
-
var getRight2 = getRight;
|
|
839
|
-
var getLeft2 = getLeft;
|
|
840
|
-
var getOrElse = /* @__PURE__ */ dual(2, (self, onNone) => isNone2(self) ? onNone() : self.value);
|
|
841
|
-
var orElse = /* @__PURE__ */ dual(2, (self, that) => isNone2(self) ? that() : self);
|
|
842
|
-
var orElseSome = /* @__PURE__ */ dual(2, (self, onNone) => isNone2(self) ? some2(onNone()) : self);
|
|
843
|
-
var orElseEither = /* @__PURE__ */ dual(2, (self, that) => isNone2(self) ? map(that(), right) : map(self, left));
|
|
844
|
-
var firstSomeOf = (collection) => {
|
|
845
|
-
let out = none2();
|
|
846
|
-
for (out of collection) {
|
|
847
|
-
if (isSome2(out)) {
|
|
848
|
-
return out;
|
|
849
|
-
}
|
|
850
|
-
}
|
|
851
|
-
return out;
|
|
852
|
-
};
|
|
853
|
-
var fromNullable = (nullableValue) => nullableValue == null ? none2() : some2(nullableValue);
|
|
854
|
-
var liftNullable = (f) => (...a) => fromNullable(f(...a));
|
|
855
|
-
var getOrNull = /* @__PURE__ */ getOrElse(constNull);
|
|
856
|
-
var getOrUndefined = /* @__PURE__ */ getOrElse(constUndefined);
|
|
857
|
-
var liftThrowable = (f) => (...a) => {
|
|
858
|
-
try {
|
|
859
|
-
return some2(f(...a));
|
|
860
|
-
} catch (e2) {
|
|
861
|
-
return none2();
|
|
862
|
-
}
|
|
863
|
-
};
|
|
864
|
-
var getOrThrowWith = /* @__PURE__ */ dual(2, (self, onNone) => {
|
|
865
|
-
if (isSome2(self)) {
|
|
866
|
-
return self.value;
|
|
867
|
-
}
|
|
868
|
-
throw onNone();
|
|
869
|
-
});
|
|
870
|
-
var getOrThrow = /* @__PURE__ */ getOrThrowWith(() => new Error("getOrThrow called on a None"));
|
|
871
|
-
var map = /* @__PURE__ */ dual(2, (self, f) => isNone2(self) ? none2() : some2(f(self.value)));
|
|
872
|
-
var as = /* @__PURE__ */ dual(2, (self, b2) => map(self, () => b2));
|
|
873
|
-
var asVoid = /* @__PURE__ */ as(void 0);
|
|
874
|
-
var void_ = /* @__PURE__ */ some2(void 0);
|
|
875
|
-
var flatMap = /* @__PURE__ */ dual(2, (self, f) => isNone2(self) ? none2() : f(self.value));
|
|
876
|
-
var andThen = /* @__PURE__ */ dual(2, (self, f) => flatMap(self, (a) => {
|
|
877
|
-
const b2 = isFunction(f) ? f(a) : f;
|
|
878
|
-
return isOption2(b2) ? b2 : some2(b2);
|
|
879
|
-
}));
|
|
880
|
-
var flatMapNullable = /* @__PURE__ */ dual(2, (self, f) => isNone2(self) ? none2() : fromNullable(f(self.value)));
|
|
881
|
-
var flatten = /* @__PURE__ */ flatMap(identity);
|
|
882
|
-
var zipRight = /* @__PURE__ */ dual(2, (self, that) => flatMap(self, () => that));
|
|
883
|
-
var composeK = /* @__PURE__ */ dual(2, (afb, bfc) => (a) => flatMap(afb(a), bfc));
|
|
884
|
-
var zipLeft = /* @__PURE__ */ dual(2, (self, that) => tap(self, () => that));
|
|
885
|
-
var tap = /* @__PURE__ */ dual(2, (self, f) => flatMap(self, (a) => map(f(a), () => a)));
|
|
886
|
-
var product = (self, that) => isSome2(self) && isSome2(that) ? some2([self.value, that.value]) : none2();
|
|
887
|
-
var productMany = (self, collection) => {
|
|
888
|
-
if (isNone2(self)) {
|
|
889
|
-
return none2();
|
|
890
|
-
}
|
|
891
|
-
const out = [self.value];
|
|
892
|
-
for (const o2 of collection) {
|
|
893
|
-
if (isNone2(o2)) {
|
|
894
|
-
return none2();
|
|
895
|
-
}
|
|
896
|
-
out.push(o2.value);
|
|
897
|
-
}
|
|
898
|
-
return some2(out);
|
|
899
|
-
};
|
|
900
|
-
var all = (input) => {
|
|
901
|
-
if (Symbol.iterator in input) {
|
|
902
|
-
const out2 = [];
|
|
903
|
-
for (const o2 of input) {
|
|
904
|
-
if (isNone2(o2)) {
|
|
905
|
-
return none2();
|
|
906
|
-
}
|
|
907
|
-
out2.push(o2.value);
|
|
908
|
-
}
|
|
909
|
-
return some2(out2);
|
|
910
|
-
}
|
|
911
|
-
const out = {};
|
|
912
|
-
for (const key of Object.keys(input)) {
|
|
913
|
-
const o2 = input[key];
|
|
914
|
-
if (isNone2(o2)) {
|
|
915
|
-
return none2();
|
|
916
|
-
}
|
|
917
|
-
out[key] = o2.value;
|
|
918
|
-
}
|
|
919
|
-
return some2(out);
|
|
920
|
-
};
|
|
921
|
-
var zipWith = /* @__PURE__ */ dual(3, (self, that, f) => map(product(self, that), ([a, b2]) => f(a, b2)));
|
|
922
|
-
var ap = /* @__PURE__ */ dual(2, (self, that) => zipWith(self, that, (f, a) => f(a)));
|
|
923
|
-
var reduceCompact = /* @__PURE__ */ dual(3, (self, b2, f) => {
|
|
924
|
-
let out = b2;
|
|
925
|
-
for (const oa of self) {
|
|
926
|
-
if (isSome2(oa)) {
|
|
927
|
-
out = f(out, oa.value);
|
|
928
|
-
}
|
|
929
|
-
}
|
|
930
|
-
return out;
|
|
931
|
-
});
|
|
932
|
-
var toArray = (self) => isNone2(self) ? [] : [self.value];
|
|
933
|
-
var partitionMap = /* @__PURE__ */ dual(2, (self, f) => {
|
|
934
|
-
if (isNone2(self)) {
|
|
935
|
-
return [none2(), none2()];
|
|
936
|
-
}
|
|
937
|
-
const e2 = f(self.value);
|
|
938
|
-
return isLeft(e2) ? [some2(e2.left), none2()] : [none2(), some2(e2.right)];
|
|
939
|
-
});
|
|
940
|
-
var filterMap = /* @__PURE__ */ dual(2, (self, f) => isNone2(self) ? none2() : f(self.value));
|
|
941
|
-
var filter = /* @__PURE__ */ dual(2, (self, predicate) => filterMap(self, (b2) => predicate(b2) ? some(b2) : none));
|
|
942
|
-
var getEquivalence = (isEquivalent) => make((x2, y2) => isNone2(x2) ? isNone2(y2) : isNone2(y2) ? false : isEquivalent(x2.value, y2.value));
|
|
943
|
-
var getOrder = (O) => make2((self, that) => isSome2(self) ? isSome2(that) ? O(self.value, that.value) : 1 : -1);
|
|
944
|
-
var lift2 = (f) => dual(2, (self, that) => zipWith(self, that, f));
|
|
945
|
-
var liftPredicate = /* @__PURE__ */ dual(2, (b2, predicate) => predicate(b2) ? some2(b2) : none2());
|
|
946
|
-
var containsWith = (isEquivalent) => dual(2, (self, a) => isNone2(self) ? false : isEquivalent(self.value, a));
|
|
947
|
-
var _equivalence = /* @__PURE__ */ equivalence();
|
|
948
|
-
var contains = /* @__PURE__ */ containsWith(_equivalence);
|
|
949
|
-
var exists = /* @__PURE__ */ dual(2, (self, refinement) => isNone2(self) ? false : refinement(self.value));
|
|
950
|
-
var bindTo2 = /* @__PURE__ */ bindTo(map);
|
|
951
|
-
var let_2 = /* @__PURE__ */ let_(map);
|
|
952
|
-
var bind2 = /* @__PURE__ */ bind(map, flatMap);
|
|
953
|
-
var Do = /* @__PURE__ */ some2({});
|
|
954
|
-
var adapter2 = /* @__PURE__ */ adapter();
|
|
955
|
-
var gen = (...args) => {
|
|
956
|
-
let f;
|
|
957
|
-
if (args.length === 1) {
|
|
958
|
-
f = args[0];
|
|
959
|
-
} else {
|
|
960
|
-
f = args[1].bind(args[0]);
|
|
961
|
-
}
|
|
962
|
-
const iterator = f(adapter2);
|
|
963
|
-
let state = iterator.next();
|
|
964
|
-
if (state.done) {
|
|
965
|
-
return some2(state.value);
|
|
966
|
-
} else {
|
|
967
|
-
let current = state.value;
|
|
968
|
-
if (isGenKind(current)) {
|
|
969
|
-
current = current.value;
|
|
970
|
-
} else {
|
|
971
|
-
current = yieldWrapGet(current);
|
|
972
|
-
}
|
|
973
|
-
if (isNone2(current)) {
|
|
974
|
-
return current;
|
|
975
|
-
}
|
|
976
|
-
while (!state.done) {
|
|
977
|
-
state = iterator.next(current.value);
|
|
978
|
-
if (!state.done) {
|
|
979
|
-
current = state.value;
|
|
980
|
-
if (isGenKind(current)) {
|
|
981
|
-
current = current.value;
|
|
982
|
-
} else {
|
|
983
|
-
current = yieldWrapGet(current);
|
|
984
|
-
}
|
|
985
|
-
if (isNone2(current)) {
|
|
986
|
-
return current;
|
|
987
|
-
}
|
|
988
|
-
}
|
|
989
|
-
}
|
|
990
|
-
return some2(state.value);
|
|
991
|
-
}
|
|
992
|
-
};
|
|
993
|
-
|
|
994
|
-
// ../../../node_modules/.pnpm/ts-pattern@5.2.0/node_modules/ts-pattern/dist/index.js
|
|
995
|
-
var t = Symbol.for("@ts-pattern/matcher");
|
|
996
|
-
var e = Symbol.for("@ts-pattern/isVariadic");
|
|
997
|
-
var n = "@ts-pattern/anonymous-select-key";
|
|
998
|
-
var r = (t2) => Boolean(t2 && "object" == typeof t2);
|
|
999
|
-
var i = (e2) => e2 && !!e2[t];
|
|
1000
|
-
var o = (n2, s2, c2) => {
|
|
1001
|
-
if (i(n2)) {
|
|
1002
|
-
const e2 = n2[t](), { matched: r2, selections: i2 } = e2.match(s2);
|
|
1003
|
-
return r2 && i2 && Object.keys(i2).forEach((t2) => c2(t2, i2[t2])), r2;
|
|
1004
|
-
}
|
|
1005
|
-
if (r(n2)) {
|
|
1006
|
-
if (!r(s2)) return false;
|
|
1007
|
-
if (Array.isArray(n2)) {
|
|
1008
|
-
if (!Array.isArray(s2)) return false;
|
|
1009
|
-
let t2 = [], r2 = [], a = [];
|
|
1010
|
-
for (const o2 of n2.keys()) {
|
|
1011
|
-
const s3 = n2[o2];
|
|
1012
|
-
i(s3) && s3[e] ? a.push(s3) : a.length ? r2.push(s3) : t2.push(s3);
|
|
1013
|
-
}
|
|
1014
|
-
if (a.length) {
|
|
1015
|
-
if (a.length > 1) throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");
|
|
1016
|
-
if (s2.length < t2.length + r2.length) return false;
|
|
1017
|
-
const e2 = s2.slice(0, t2.length), n3 = 0 === r2.length ? [] : s2.slice(-r2.length), i2 = s2.slice(t2.length, 0 === r2.length ? Infinity : -r2.length);
|
|
1018
|
-
return t2.every((t3, n4) => o(t3, e2[n4], c2)) && r2.every((t3, e3) => o(t3, n3[e3], c2)) && (0 === a.length || o(a[0], i2, c2));
|
|
1019
|
-
}
|
|
1020
|
-
return n2.length === s2.length && n2.every((t3, e2) => o(t3, s2[e2], c2));
|
|
1021
|
-
}
|
|
1022
|
-
return Object.keys(n2).every((e2) => {
|
|
1023
|
-
const r2 = n2[e2];
|
|
1024
|
-
return (e2 in s2 || i(a = r2) && "optional" === a[t]().matcherType) && o(r2, s2[e2], c2);
|
|
1025
|
-
var a;
|
|
1026
|
-
});
|
|
1027
|
-
}
|
|
1028
|
-
return Object.is(s2, n2);
|
|
1029
|
-
};
|
|
1030
|
-
var s = (e2) => {
|
|
1031
|
-
var n2, o2, a;
|
|
1032
|
-
return r(e2) ? i(e2) ? null != (n2 = null == (o2 = (a = e2[t]()).getSelectionKeys) ? void 0 : o2.call(a)) ? n2 : [] : Array.isArray(e2) ? c(e2, s) : c(Object.values(e2), s) : [];
|
|
1033
|
-
};
|
|
1034
|
-
var c = (t2, e2) => t2.reduce((t3, n2) => t3.concat(e2(n2)), []);
|
|
1035
|
-
function u(t2) {
|
|
1036
|
-
return Object.assign(t2, { optional: () => l(t2), and: (e2) => m(t2, e2), or: (e2) => d(t2, e2), select: (e2) => void 0 === e2 ? p(t2) : p(e2, t2) });
|
|
1037
|
-
}
|
|
1038
|
-
function l(e2) {
|
|
1039
|
-
return u({ [t]: () => ({ match: (t2) => {
|
|
1040
|
-
let n2 = {};
|
|
1041
|
-
const r2 = (t3, e3) => {
|
|
1042
|
-
n2[t3] = e3;
|
|
1043
|
-
};
|
|
1044
|
-
return void 0 === t2 ? (s(e2).forEach((t3) => r2(t3, void 0)), { matched: true, selections: n2 }) : { matched: o(e2, t2, r2), selections: n2 };
|
|
1045
|
-
}, getSelectionKeys: () => s(e2), matcherType: "optional" }) });
|
|
1046
|
-
}
|
|
1047
|
-
function m(...e2) {
|
|
1048
|
-
return u({ [t]: () => ({ match: (t2) => {
|
|
1049
|
-
let n2 = {};
|
|
1050
|
-
const r2 = (t3, e3) => {
|
|
1051
|
-
n2[t3] = e3;
|
|
1052
|
-
};
|
|
1053
|
-
return { matched: e2.every((e3) => o(e3, t2, r2)), selections: n2 };
|
|
1054
|
-
}, getSelectionKeys: () => c(e2, s), matcherType: "and" }) });
|
|
1055
|
-
}
|
|
1056
|
-
function d(...e2) {
|
|
1057
|
-
return u({ [t]: () => ({ match: (t2) => {
|
|
1058
|
-
let n2 = {};
|
|
1059
|
-
const r2 = (t3, e3) => {
|
|
1060
|
-
n2[t3] = e3;
|
|
1061
|
-
};
|
|
1062
|
-
return c(e2, s).forEach((t3) => r2(t3, void 0)), { matched: e2.some((e3) => o(e3, t2, r2)), selections: n2 };
|
|
1063
|
-
}, getSelectionKeys: () => c(e2, s), matcherType: "or" }) });
|
|
1064
|
-
}
|
|
1065
|
-
function y(e2) {
|
|
1066
|
-
return { [t]: () => ({ match: (t2) => ({ matched: Boolean(e2(t2)) }) }) };
|
|
1067
|
-
}
|
|
1068
|
-
function p(...e2) {
|
|
1069
|
-
const r2 = "string" == typeof e2[0] ? e2[0] : void 0, i2 = 2 === e2.length ? e2[1] : "string" == typeof e2[0] ? void 0 : e2[0];
|
|
1070
|
-
return u({ [t]: () => ({ match: (t2) => {
|
|
1071
|
-
let e3 = { [null != r2 ? r2 : n]: t2 };
|
|
1072
|
-
return { matched: void 0 === i2 || o(i2, t2, (t3, n2) => {
|
|
1073
|
-
e3[t3] = n2;
|
|
1074
|
-
}), selections: e3 };
|
|
1075
|
-
}, getSelectionKeys: () => [null != r2 ? r2 : n].concat(void 0 === i2 ? [] : s(i2)) }) });
|
|
1076
|
-
}
|
|
1077
|
-
function v(t2) {
|
|
1078
|
-
return "number" == typeof t2;
|
|
1079
|
-
}
|
|
1080
|
-
function b(t2) {
|
|
1081
|
-
return "string" == typeof t2;
|
|
1082
|
-
}
|
|
1083
|
-
function w(t2) {
|
|
1084
|
-
return "bigint" == typeof t2;
|
|
1085
|
-
}
|
|
1086
|
-
u(y(function(t2) {
|
|
1087
|
-
return true;
|
|
1088
|
-
}));
|
|
1089
|
-
var j = (t2) => Object.assign(u(t2), { startsWith: (e2) => {
|
|
1090
|
-
return j(m(t2, (n2 = e2, y((t3) => b(t3) && t3.startsWith(n2)))));
|
|
1091
|
-
var n2;
|
|
1092
|
-
}, endsWith: (e2) => {
|
|
1093
|
-
return j(m(t2, (n2 = e2, y((t3) => b(t3) && t3.endsWith(n2)))));
|
|
1094
|
-
var n2;
|
|
1095
|
-
}, minLength: (e2) => j(m(t2, ((t3) => y((e3) => b(e3) && e3.length >= t3))(e2))), length: (e2) => j(m(t2, ((t3) => y((e3) => b(e3) && e3.length === t3))(e2))), maxLength: (e2) => j(m(t2, ((t3) => y((e3) => b(e3) && e3.length <= t3))(e2))), includes: (e2) => {
|
|
1096
|
-
return j(m(t2, (n2 = e2, y((t3) => b(t3) && t3.includes(n2)))));
|
|
1097
|
-
var n2;
|
|
1098
|
-
}, regex: (e2) => {
|
|
1099
|
-
return j(m(t2, (n2 = e2, y((t3) => b(t3) && Boolean(t3.match(n2))))));
|
|
1100
|
-
var n2;
|
|
1101
|
-
} });
|
|
1102
|
-
j(y(b));
|
|
1103
|
-
var K = (t2) => Object.assign(u(t2), { between: (e2, n2) => K(m(t2, ((t3, e3) => y((n3) => v(n3) && t3 <= n3 && e3 >= n3))(e2, n2))), lt: (e2) => K(m(t2, ((t3) => y((e3) => v(e3) && e3 < t3))(e2))), gt: (e2) => K(m(t2, ((t3) => y((e3) => v(e3) && e3 > t3))(e2))), lte: (e2) => K(m(t2, ((t3) => y((e3) => v(e3) && e3 <= t3))(e2))), gte: (e2) => K(m(t2, ((t3) => y((e3) => v(e3) && e3 >= t3))(e2))), int: () => K(m(t2, y((t3) => v(t3) && Number.isInteger(t3)))), finite: () => K(m(t2, y((t3) => v(t3) && Number.isFinite(t3)))), positive: () => K(m(t2, y((t3) => v(t3) && t3 > 0))), negative: () => K(m(t2, y((t3) => v(t3) && t3 < 0))) });
|
|
1104
|
-
K(y(v));
|
|
1105
|
-
var A = (t2) => Object.assign(u(t2), { between: (e2, n2) => A(m(t2, ((t3, e3) => y((n3) => w(n3) && t3 <= n3 && e3 >= n3))(e2, n2))), lt: (e2) => A(m(t2, ((t3) => y((e3) => w(e3) && e3 < t3))(e2))), gt: (e2) => A(m(t2, ((t3) => y((e3) => w(e3) && e3 > t3))(e2))), lte: (e2) => A(m(t2, ((t3) => y((e3) => w(e3) && e3 <= t3))(e2))), gte: (e2) => A(m(t2, ((t3) => y((e3) => w(e3) && e3 >= t3))(e2))), positive: () => A(m(t2, y((t3) => w(t3) && t3 > 0))), negative: () => A(m(t2, y((t3) => w(t3) && t3 < 0))) });
|
|
1106
|
-
A(y(w));
|
|
1107
|
-
u(y(function(t2) {
|
|
1108
|
-
return "boolean" == typeof t2;
|
|
1109
|
-
}));
|
|
1110
|
-
u(y(function(t2) {
|
|
1111
|
-
return "symbol" == typeof t2;
|
|
1112
|
-
}));
|
|
1113
|
-
u(y(function(t2) {
|
|
1114
|
-
return null == t2;
|
|
1115
|
-
}));
|
|
1116
|
-
u(y(function(t2) {
|
|
1117
|
-
return null != t2;
|
|
1118
|
-
}));
|
|
1119
|
-
var W = { matched: false, value: void 0 };
|
|
1120
|
-
function $(t2) {
|
|
1121
|
-
return new z(t2, W);
|
|
1122
|
-
}
|
|
1123
|
-
var z = class _z {
|
|
1124
|
-
constructor(t2, e2) {
|
|
1125
|
-
this.input = void 0, this.state = void 0, this.input = t2, this.state = e2;
|
|
1126
|
-
}
|
|
1127
|
-
with(...t2) {
|
|
1128
|
-
if (this.state.matched) return this;
|
|
1129
|
-
const e2 = t2[t2.length - 1], r2 = [t2[0]];
|
|
1130
|
-
let i2;
|
|
1131
|
-
3 === t2.length && "function" == typeof t2[1] ? i2 = t2[1] : t2.length > 2 && r2.push(...t2.slice(1, t2.length - 1));
|
|
1132
|
-
let s2 = false, c2 = {};
|
|
1133
|
-
const a = (t3, e3) => {
|
|
1134
|
-
s2 = true, c2[t3] = e3;
|
|
1135
|
-
}, u2 = !r2.some((t3) => o(t3, this.input, a)) || i2 && !Boolean(i2(this.input)) ? W : { matched: true, value: e2(s2 ? n in c2 ? c2[n] : c2 : this.input, this.input) };
|
|
1136
|
-
return new _z(this.input, u2);
|
|
1137
|
-
}
|
|
1138
|
-
when(t2, e2) {
|
|
1139
|
-
if (this.state.matched) return this;
|
|
1140
|
-
const n2 = Boolean(t2(this.input));
|
|
1141
|
-
return new _z(this.input, n2 ? { matched: true, value: e2(this.input, this.input) } : W);
|
|
1142
|
-
}
|
|
1143
|
-
otherwise(t2) {
|
|
1144
|
-
return this.state.matched ? this.state.value : t2(this.input);
|
|
1145
|
-
}
|
|
1146
|
-
exhaustive() {
|
|
1147
|
-
if (this.state.matched) return this.state.value;
|
|
1148
|
-
let t2;
|
|
1149
|
-
try {
|
|
1150
|
-
t2 = JSON.stringify(this.input);
|
|
1151
|
-
} catch (e2) {
|
|
1152
|
-
t2 = this.input;
|
|
1153
|
-
}
|
|
1154
|
-
throw new Error(`Pattern matching error: no pattern matches value ${t2}`);
|
|
1155
|
-
}
|
|
1156
|
-
run() {
|
|
1157
|
-
return this.exhaustive();
|
|
1158
|
-
}
|
|
1159
|
-
returnType() {
|
|
1160
|
-
return this;
|
|
1161
|
-
}
|
|
1162
|
-
};
|
|
1163
|
-
|
|
1164
|
-
// src/rules/ensure-use-callback-has-non-empty-deps.ts
|
|
1165
51
|
var RULE_NAME2 = "ensure-use-callback-has-non-empty-deps";
|
|
1166
52
|
var ensure_use_callback_has_non_empty_deps_default = createRule({
|
|
1167
53
|
meta: {
|
|
@@ -1182,10 +68,10 @@ var ensure_use_callback_has_non_empty_deps_default = createRule({
|
|
|
1182
68
|
CallExpression(node) {
|
|
1183
69
|
const initialScope = context.sourceCode.getScope(node);
|
|
1184
70
|
if (!core.isReactHookCall(node)) return;
|
|
1185
|
-
if (!core.isUseCallbackCall(node, context) && !alias.some(
|
|
71
|
+
if (!core.isUseCallbackCall(node, context) && !alias.some(effect.Function.flip(core.isReactHookCallWithNameLoose)(node))) {
|
|
1186
72
|
return;
|
|
1187
73
|
}
|
|
1188
|
-
const [
|
|
74
|
+
const [_, deps] = node.arguments;
|
|
1189
75
|
if (!deps) {
|
|
1190
76
|
context.report({
|
|
1191
77
|
messageId: "ENSURE_USE_CALLBACK_HAS_NON_EMPTY_DEPS",
|
|
@@ -1193,21 +79,21 @@ var ensure_use_callback_has_non_empty_deps_default = createRule({
|
|
|
1193
79
|
});
|
|
1194
80
|
return;
|
|
1195
81
|
}
|
|
1196
|
-
const maybeDescriptor =
|
|
1197
|
-
|
|
1198
|
-
return
|
|
1199
|
-
_var.findVariable(
|
|
1200
|
-
|
|
1201
|
-
|
|
82
|
+
const maybeDescriptor = effect.Function.pipe(
|
|
83
|
+
tsPattern.match(deps).with({ type: ast.NodeType.ArrayExpression }, effect.Option.some).with({ type: ast.NodeType.Identifier }, (n) => {
|
|
84
|
+
return effect.Function.pipe(
|
|
85
|
+
_var.findVariable(n.name, initialScope),
|
|
86
|
+
effect.Option.flatMap(_var.getVariableInit(0)),
|
|
87
|
+
effect.Option.filter(ast.is(ast.NodeType.ArrayExpression))
|
|
1202
88
|
);
|
|
1203
|
-
}).otherwise(
|
|
1204
|
-
|
|
1205
|
-
|
|
89
|
+
}).otherwise(effect.Option.none),
|
|
90
|
+
effect.Option.filter((x) => x.elements.length === 0),
|
|
91
|
+
effect.Option.map(() => ({
|
|
1206
92
|
messageId: "ENSURE_USE_CALLBACK_HAS_NON_EMPTY_DEPS",
|
|
1207
93
|
node
|
|
1208
94
|
}))
|
|
1209
95
|
);
|
|
1210
|
-
|
|
96
|
+
effect.Option.map(maybeDescriptor, context.report);
|
|
1211
97
|
}
|
|
1212
98
|
};
|
|
1213
99
|
},
|
|
@@ -1233,8 +119,8 @@ var ensure_use_memo_has_non_empty_deps_default = createRule({
|
|
|
1233
119
|
CallExpression(node) {
|
|
1234
120
|
const initialScope = context.sourceCode.getScope(node);
|
|
1235
121
|
if (!core.isReactHookCall(node)) return;
|
|
1236
|
-
if (!core.isUseMemoCall(node, context) && !alias.some(
|
|
1237
|
-
const [
|
|
122
|
+
if (!core.isUseMemoCall(node, context) && !alias.some(effect.Function.flip(core.isReactHookCallWithNameLoose)(node))) return;
|
|
123
|
+
const [_, deps] = node.arguments;
|
|
1238
124
|
if (!deps) {
|
|
1239
125
|
context.report({
|
|
1240
126
|
messageId: "ENSURE_USE_MEMO_HAS_NON_EMPTY_DEPS",
|
|
@@ -1242,21 +128,21 @@ var ensure_use_memo_has_non_empty_deps_default = createRule({
|
|
|
1242
128
|
});
|
|
1243
129
|
return;
|
|
1244
130
|
}
|
|
1245
|
-
const maybeDescriptor =
|
|
1246
|
-
|
|
1247
|
-
return
|
|
1248
|
-
_var.findVariable(
|
|
1249
|
-
|
|
1250
|
-
|
|
131
|
+
const maybeDescriptor = effect.Function.pipe(
|
|
132
|
+
tsPattern.match(deps).with({ type: ast.NodeType.ArrayExpression }, effect.Option.some).with({ type: ast.NodeType.Identifier }, (n) => {
|
|
133
|
+
return effect.Function.pipe(
|
|
134
|
+
_var.findVariable(n.name, initialScope),
|
|
135
|
+
effect.Option.flatMap(_var.getVariableInit(0)),
|
|
136
|
+
effect.Option.filter(ast.is(ast.NodeType.ArrayExpression))
|
|
1251
137
|
);
|
|
1252
|
-
}).otherwise(
|
|
1253
|
-
|
|
1254
|
-
|
|
138
|
+
}).otherwise(effect.Option.none),
|
|
139
|
+
effect.Option.filter((x) => x.elements.length === 0),
|
|
140
|
+
effect.Option.map(() => ({
|
|
1255
141
|
messageId: "ENSURE_USE_MEMO_HAS_NON_EMPTY_DEPS",
|
|
1256
142
|
node
|
|
1257
143
|
}))
|
|
1258
144
|
);
|
|
1259
|
-
|
|
145
|
+
effect.Option.map(maybeDescriptor, context.report);
|
|
1260
146
|
}
|
|
1261
147
|
};
|
|
1262
148
|
},
|
|
@@ -1282,12 +168,12 @@ var prefer_use_state_lazy_initialization_default = createRule({
|
|
|
1282
168
|
return {
|
|
1283
169
|
CallExpression(node) {
|
|
1284
170
|
if (!core.isReactHookCall(node)) return;
|
|
1285
|
-
if (!core.isUseStateCall(node, context) && !alias.some(
|
|
171
|
+
if (!core.isUseStateCall(node, context) && !alias.some(effect.Function.flip(core.isReactHookCallWithNameLoose)(node))) return;
|
|
1286
172
|
const [useStateInput] = node.arguments;
|
|
1287
173
|
if (!useStateInput) return;
|
|
1288
174
|
const nestedCallExpressions = ast.getNestedCallExpressions(useStateInput);
|
|
1289
|
-
const hasFunctionCall = nestedCallExpressions.some((
|
|
1290
|
-
return "name" in
|
|
175
|
+
const hasFunctionCall = nestedCallExpressions.some((n) => {
|
|
176
|
+
return "name" in n.callee && !ALLOW_LIST.includes(n.callee.name);
|
|
1291
177
|
});
|
|
1292
178
|
if (!hasFunctionCall) return;
|
|
1293
179
|
context.report({
|