eslint-plugin-react-hooks-extra 1.5.18 → 1.5.19-beta.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 +1008 -27
- package/dist/index.mjs +1005 -24
- package/package.json +12 -12
package/dist/index.mjs
CHANGED
|
@@ -2,12 +2,16 @@ import { useHookCollector, isReactHookCall, isUseCallbackCall, isReactHookCallWi
|
|
|
2
2
|
import { createRuleForPlugin, ESLintSettingsSchema } from '@eslint-react/shared';
|
|
3
3
|
import { NodeType, is, getNestedCallExpressions } from '@eslint-react/ast';
|
|
4
4
|
import { findVariable, getVariableInit } from '@eslint-react/var';
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
|
|
6
|
+
var __defProp = Object.defineProperty;
|
|
7
|
+
var __export = (target, all2) => {
|
|
8
|
+
for (var name2 in all2)
|
|
9
|
+
__defProp(target, name2, { get: all2[name2], enumerable: true });
|
|
10
|
+
};
|
|
7
11
|
|
|
8
12
|
// package.json
|
|
9
13
|
var name = "eslint-plugin-react-hooks-extra";
|
|
10
|
-
var version = "1.5.
|
|
14
|
+
var version = "1.5.19-beta.0";
|
|
11
15
|
var createRule = createRuleForPlugin("hooks-extra");
|
|
12
16
|
|
|
13
17
|
// src/rules/ensure-custom-hooks-using-other-hooks.ts
|
|
@@ -47,6 +51,944 @@ var ensure_custom_hooks_using_other_hooks_default = createRule({
|
|
|
47
51
|
defaultOptions: []
|
|
48
52
|
});
|
|
49
53
|
|
|
54
|
+
// ../../../node_modules/.pnpm/effect@3.4.5/node_modules/effect/dist/esm/Function.js
|
|
55
|
+
var Function_exports = {};
|
|
56
|
+
__export(Function_exports, {
|
|
57
|
+
SK: () => SK,
|
|
58
|
+
absurd: () => absurd,
|
|
59
|
+
apply: () => apply,
|
|
60
|
+
compose: () => compose,
|
|
61
|
+
constFalse: () => constFalse,
|
|
62
|
+
constNull: () => constNull,
|
|
63
|
+
constTrue: () => constTrue,
|
|
64
|
+
constUndefined: () => constUndefined,
|
|
65
|
+
constVoid: () => constVoid,
|
|
66
|
+
constant: () => constant,
|
|
67
|
+
dual: () => dual,
|
|
68
|
+
flip: () => flip,
|
|
69
|
+
flow: () => flow,
|
|
70
|
+
hole: () => hole,
|
|
71
|
+
identity: () => identity,
|
|
72
|
+
isFunction: () => isFunction,
|
|
73
|
+
pipe: () => pipe,
|
|
74
|
+
satisfies: () => satisfies,
|
|
75
|
+
tupled: () => tupled,
|
|
76
|
+
unsafeCoerce: () => unsafeCoerce,
|
|
77
|
+
untupled: () => untupled
|
|
78
|
+
});
|
|
79
|
+
var isFunction = (input) => typeof input === "function";
|
|
80
|
+
var dual = function(arity, body) {
|
|
81
|
+
if (typeof arity === "function") {
|
|
82
|
+
return function() {
|
|
83
|
+
if (arity(arguments)) {
|
|
84
|
+
return body.apply(this, arguments);
|
|
85
|
+
}
|
|
86
|
+
return (self) => body(self, ...arguments);
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
switch (arity) {
|
|
90
|
+
case 0:
|
|
91
|
+
case 1:
|
|
92
|
+
throw new RangeError(`Invalid arity ${arity}`);
|
|
93
|
+
case 2:
|
|
94
|
+
return function(a, b2) {
|
|
95
|
+
if (arguments.length >= 2) {
|
|
96
|
+
return body(a, b2);
|
|
97
|
+
}
|
|
98
|
+
return function(self) {
|
|
99
|
+
return body(self, a);
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
case 3:
|
|
103
|
+
return function(a, b2, c2) {
|
|
104
|
+
if (arguments.length >= 3) {
|
|
105
|
+
return body(a, b2, c2);
|
|
106
|
+
}
|
|
107
|
+
return function(self) {
|
|
108
|
+
return body(self, a, b2);
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
case 4:
|
|
112
|
+
return function(a, b2, c2, d2) {
|
|
113
|
+
if (arguments.length >= 4) {
|
|
114
|
+
return body(a, b2, c2, d2);
|
|
115
|
+
}
|
|
116
|
+
return function(self) {
|
|
117
|
+
return body(self, a, b2, c2);
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
case 5:
|
|
121
|
+
return function(a, b2, c2, d2, e2) {
|
|
122
|
+
if (arguments.length >= 5) {
|
|
123
|
+
return body(a, b2, c2, d2, e2);
|
|
124
|
+
}
|
|
125
|
+
return function(self) {
|
|
126
|
+
return body(self, a, b2, c2, d2);
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
default:
|
|
130
|
+
return function() {
|
|
131
|
+
if (arguments.length >= arity) {
|
|
132
|
+
return body.apply(this, arguments);
|
|
133
|
+
}
|
|
134
|
+
const args = arguments;
|
|
135
|
+
return function(self) {
|
|
136
|
+
return body(self, ...args);
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
var apply = (a) => (self) => self(a);
|
|
142
|
+
var identity = (a) => a;
|
|
143
|
+
var satisfies = () => (b2) => b2;
|
|
144
|
+
var unsafeCoerce = identity;
|
|
145
|
+
var constant = (value) => () => value;
|
|
146
|
+
var constTrue = /* @__PURE__ */ constant(true);
|
|
147
|
+
var constFalse = /* @__PURE__ */ constant(false);
|
|
148
|
+
var constNull = /* @__PURE__ */ constant(null);
|
|
149
|
+
var constUndefined = /* @__PURE__ */ constant(void 0);
|
|
150
|
+
var constVoid = constUndefined;
|
|
151
|
+
var flip = (f) => (...b2) => (...a) => f(...a)(...b2);
|
|
152
|
+
var compose = /* @__PURE__ */ dual(2, (ab, bc) => (a) => bc(ab(a)));
|
|
153
|
+
var absurd = (_2) => {
|
|
154
|
+
throw new Error("Called `absurd` function which should be uncallable");
|
|
155
|
+
};
|
|
156
|
+
var tupled = (f) => (a) => f(...a);
|
|
157
|
+
var untupled = (f) => (...a) => f(a);
|
|
158
|
+
function pipe(a, ab, bc, cd, de, ef, fg, gh, hi) {
|
|
159
|
+
switch (arguments.length) {
|
|
160
|
+
case 1:
|
|
161
|
+
return a;
|
|
162
|
+
case 2:
|
|
163
|
+
return ab(a);
|
|
164
|
+
case 3:
|
|
165
|
+
return bc(ab(a));
|
|
166
|
+
case 4:
|
|
167
|
+
return cd(bc(ab(a)));
|
|
168
|
+
case 5:
|
|
169
|
+
return de(cd(bc(ab(a))));
|
|
170
|
+
case 6:
|
|
171
|
+
return ef(de(cd(bc(ab(a)))));
|
|
172
|
+
case 7:
|
|
173
|
+
return fg(ef(de(cd(bc(ab(a))))));
|
|
174
|
+
case 8:
|
|
175
|
+
return gh(fg(ef(de(cd(bc(ab(a)))))));
|
|
176
|
+
case 9:
|
|
177
|
+
return hi(gh(fg(ef(de(cd(bc(ab(a))))))));
|
|
178
|
+
default: {
|
|
179
|
+
let ret = arguments[0];
|
|
180
|
+
for (let i2 = 1; i2 < arguments.length; i2++) {
|
|
181
|
+
ret = arguments[i2](ret);
|
|
182
|
+
}
|
|
183
|
+
return ret;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
function flow(ab, bc, cd, de, ef, fg, gh, hi, ij) {
|
|
188
|
+
switch (arguments.length) {
|
|
189
|
+
case 1:
|
|
190
|
+
return ab;
|
|
191
|
+
case 2:
|
|
192
|
+
return function() {
|
|
193
|
+
return bc(ab.apply(this, arguments));
|
|
194
|
+
};
|
|
195
|
+
case 3:
|
|
196
|
+
return function() {
|
|
197
|
+
return cd(bc(ab.apply(this, arguments)));
|
|
198
|
+
};
|
|
199
|
+
case 4:
|
|
200
|
+
return function() {
|
|
201
|
+
return de(cd(bc(ab.apply(this, arguments))));
|
|
202
|
+
};
|
|
203
|
+
case 5:
|
|
204
|
+
return function() {
|
|
205
|
+
return ef(de(cd(bc(ab.apply(this, arguments)))));
|
|
206
|
+
};
|
|
207
|
+
case 6:
|
|
208
|
+
return function() {
|
|
209
|
+
return fg(ef(de(cd(bc(ab.apply(this, arguments))))));
|
|
210
|
+
};
|
|
211
|
+
case 7:
|
|
212
|
+
return function() {
|
|
213
|
+
return gh(fg(ef(de(cd(bc(ab.apply(this, arguments)))))));
|
|
214
|
+
};
|
|
215
|
+
case 8:
|
|
216
|
+
return function() {
|
|
217
|
+
return hi(gh(fg(ef(de(cd(bc(ab.apply(this, arguments))))))));
|
|
218
|
+
};
|
|
219
|
+
case 9:
|
|
220
|
+
return function() {
|
|
221
|
+
return ij(hi(gh(fg(ef(de(cd(bc(ab.apply(this, arguments)))))))));
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
var hole = /* @__PURE__ */ unsafeCoerce(absurd);
|
|
227
|
+
var SK = (_2, b2) => b2;
|
|
228
|
+
|
|
229
|
+
// ../../../node_modules/.pnpm/effect@3.4.5/node_modules/effect/dist/esm/Equivalence.js
|
|
230
|
+
var make = (isEquivalent) => (self, that) => self === that || isEquivalent(self, that);
|
|
231
|
+
|
|
232
|
+
// ../../../node_modules/.pnpm/effect@3.4.5/node_modules/effect/dist/esm/internal/doNotation.js
|
|
233
|
+
var let_ = (map2) => dual(3, (self, name2, f) => map2(self, (a) => Object.assign({}, a, {
|
|
234
|
+
[name2]: f(a)
|
|
235
|
+
})));
|
|
236
|
+
var bindTo = (map2) => dual(2, (self, name2) => map2(self, (a) => ({
|
|
237
|
+
[name2]: a
|
|
238
|
+
})));
|
|
239
|
+
var bind = (map2, flatMap2) => dual(3, (self, name2, f) => flatMap2(self, (a) => map2(f(a), (b2) => Object.assign({}, a, {
|
|
240
|
+
[name2]: b2
|
|
241
|
+
}))));
|
|
242
|
+
|
|
243
|
+
// ../../../node_modules/.pnpm/effect@3.4.5/node_modules/effect/dist/esm/internal/version.js
|
|
244
|
+
var moduleVersion = "3.4.5";
|
|
245
|
+
var getCurrentVersion = () => moduleVersion;
|
|
246
|
+
|
|
247
|
+
// ../../../node_modules/.pnpm/effect@3.4.5/node_modules/effect/dist/esm/GlobalValue.js
|
|
248
|
+
var globalStoreId = /* @__PURE__ */ Symbol.for(`effect/GlobalValue/globalStoreId/${/* @__PURE__ */ getCurrentVersion()}`);
|
|
249
|
+
if (!(globalStoreId in globalThis)) {
|
|
250
|
+
globalThis[globalStoreId] = /* @__PURE__ */ new Map();
|
|
251
|
+
}
|
|
252
|
+
var globalStore = globalThis[globalStoreId];
|
|
253
|
+
var globalValue = (id, compute) => {
|
|
254
|
+
if (!globalStore.has(id)) {
|
|
255
|
+
globalStore.set(id, compute());
|
|
256
|
+
}
|
|
257
|
+
return globalStore.get(id);
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
// ../../../node_modules/.pnpm/effect@3.4.5/node_modules/effect/dist/esm/Predicate.js
|
|
261
|
+
var isFunction2 = isFunction;
|
|
262
|
+
var isRecordOrArray = (input) => typeof input === "object" && input !== null;
|
|
263
|
+
var isObject = (input) => isRecordOrArray(input) || isFunction2(input);
|
|
264
|
+
var hasProperty = /* @__PURE__ */ dual(2, (self, property) => isObject(self) && property in self);
|
|
265
|
+
|
|
266
|
+
// ../../../node_modules/.pnpm/effect@3.4.5/node_modules/effect/dist/esm/internal/errors.js
|
|
267
|
+
var getBugErrorMessage = (message) => `BUG: ${message} - please report an issue at https://github.com/Effect-TS/effect/issues`;
|
|
268
|
+
|
|
269
|
+
// ../../../node_modules/.pnpm/effect@3.4.5/node_modules/effect/dist/esm/Utils.js
|
|
270
|
+
var GenKindTypeId = /* @__PURE__ */ Symbol.for("effect/Gen/GenKind");
|
|
271
|
+
var isGenKind = (u2) => isObject(u2) && GenKindTypeId in u2;
|
|
272
|
+
var GenKindImpl = class {
|
|
273
|
+
value;
|
|
274
|
+
constructor(value) {
|
|
275
|
+
this.value = value;
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* @since 2.0.0
|
|
279
|
+
*/
|
|
280
|
+
get _F() {
|
|
281
|
+
return identity;
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* @since 2.0.0
|
|
285
|
+
*/
|
|
286
|
+
get _R() {
|
|
287
|
+
return (_2) => _2;
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* @since 2.0.0
|
|
291
|
+
*/
|
|
292
|
+
get _O() {
|
|
293
|
+
return (_2) => _2;
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* @since 2.0.0
|
|
297
|
+
*/
|
|
298
|
+
get _E() {
|
|
299
|
+
return (_2) => _2;
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* @since 2.0.0
|
|
303
|
+
*/
|
|
304
|
+
[GenKindTypeId] = GenKindTypeId;
|
|
305
|
+
/**
|
|
306
|
+
* @since 2.0.0
|
|
307
|
+
*/
|
|
308
|
+
[Symbol.iterator]() {
|
|
309
|
+
return new SingleShotGen(this);
|
|
310
|
+
}
|
|
311
|
+
};
|
|
312
|
+
var SingleShotGen = class _SingleShotGen {
|
|
313
|
+
self;
|
|
314
|
+
called = false;
|
|
315
|
+
constructor(self) {
|
|
316
|
+
this.self = self;
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* @since 2.0.0
|
|
320
|
+
*/
|
|
321
|
+
next(a) {
|
|
322
|
+
return this.called ? {
|
|
323
|
+
value: a,
|
|
324
|
+
done: true
|
|
325
|
+
} : (this.called = true, {
|
|
326
|
+
value: this.self,
|
|
327
|
+
done: false
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* @since 2.0.0
|
|
332
|
+
*/
|
|
333
|
+
return(a) {
|
|
334
|
+
return {
|
|
335
|
+
value: a,
|
|
336
|
+
done: true
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* @since 2.0.0
|
|
341
|
+
*/
|
|
342
|
+
throw(e2) {
|
|
343
|
+
throw e2;
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* @since 2.0.0
|
|
347
|
+
*/
|
|
348
|
+
[Symbol.iterator]() {
|
|
349
|
+
return new _SingleShotGen(this.self);
|
|
350
|
+
}
|
|
351
|
+
};
|
|
352
|
+
var adapter = () => function() {
|
|
353
|
+
let x2 = arguments[0];
|
|
354
|
+
for (let i2 = 1; i2 < arguments.length; i2++) {
|
|
355
|
+
x2 = arguments[i2](x2);
|
|
356
|
+
}
|
|
357
|
+
return new GenKindImpl(x2);
|
|
358
|
+
};
|
|
359
|
+
var YieldWrapTypeId = /* @__PURE__ */ Symbol.for("effect/Utils/YieldWrap");
|
|
360
|
+
var YieldWrap = class {
|
|
361
|
+
/**
|
|
362
|
+
* @since 3.0.6
|
|
363
|
+
*/
|
|
364
|
+
#value;
|
|
365
|
+
constructor(value) {
|
|
366
|
+
this.#value = value;
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* @since 3.0.6
|
|
370
|
+
*/
|
|
371
|
+
[YieldWrapTypeId]() {
|
|
372
|
+
return this.#value;
|
|
373
|
+
}
|
|
374
|
+
};
|
|
375
|
+
function yieldWrapGet(self) {
|
|
376
|
+
if (typeof self === "object" && self !== null && YieldWrapTypeId in self) {
|
|
377
|
+
return self[YieldWrapTypeId]();
|
|
378
|
+
}
|
|
379
|
+
throw new Error(getBugErrorMessage("yieldWrapGet"));
|
|
380
|
+
}
|
|
381
|
+
var structuralRegionState = /* @__PURE__ */ globalValue("effect/Utils/isStructuralRegion", () => ({
|
|
382
|
+
enabled: false,
|
|
383
|
+
tester: void 0
|
|
384
|
+
}));
|
|
385
|
+
|
|
386
|
+
// ../../../node_modules/.pnpm/effect@3.4.5/node_modules/effect/dist/esm/Hash.js
|
|
387
|
+
var randomHashCache = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("effect/Hash/randomHashCache"), () => /* @__PURE__ */ new WeakMap());
|
|
388
|
+
var symbol = /* @__PURE__ */ Symbol.for("effect/Hash");
|
|
389
|
+
var hash = (self) => {
|
|
390
|
+
if (structuralRegionState.enabled === true) {
|
|
391
|
+
return 0;
|
|
392
|
+
}
|
|
393
|
+
switch (typeof self) {
|
|
394
|
+
case "number":
|
|
395
|
+
return number(self);
|
|
396
|
+
case "bigint":
|
|
397
|
+
return string(self.toString(10));
|
|
398
|
+
case "boolean":
|
|
399
|
+
return string(String(self));
|
|
400
|
+
case "symbol":
|
|
401
|
+
return string(String(self));
|
|
402
|
+
case "string":
|
|
403
|
+
return string(self);
|
|
404
|
+
case "undefined":
|
|
405
|
+
return string("undefined");
|
|
406
|
+
case "function":
|
|
407
|
+
case "object": {
|
|
408
|
+
if (self === null) {
|
|
409
|
+
return string("null");
|
|
410
|
+
} else if (self instanceof Date) {
|
|
411
|
+
return hash(self.toISOString());
|
|
412
|
+
} else if (isHash(self)) {
|
|
413
|
+
return self[symbol]();
|
|
414
|
+
} else {
|
|
415
|
+
return random(self);
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
default:
|
|
419
|
+
throw new Error(`BUG: unhandled typeof ${typeof self} - please report an issue at https://github.com/Effect-TS/effect/issues`);
|
|
420
|
+
}
|
|
421
|
+
};
|
|
422
|
+
var random = (self) => {
|
|
423
|
+
if (!randomHashCache.has(self)) {
|
|
424
|
+
randomHashCache.set(self, number(Math.floor(Math.random() * Number.MAX_SAFE_INTEGER)));
|
|
425
|
+
}
|
|
426
|
+
return randomHashCache.get(self);
|
|
427
|
+
};
|
|
428
|
+
var combine = (b2) => (self) => self * 53 ^ b2;
|
|
429
|
+
var optimize = (n2) => n2 & 3221225471 | n2 >>> 1 & 1073741824;
|
|
430
|
+
var isHash = (u2) => hasProperty(u2, symbol);
|
|
431
|
+
var number = (n2) => {
|
|
432
|
+
if (n2 !== n2 || n2 === Infinity) {
|
|
433
|
+
return 0;
|
|
434
|
+
}
|
|
435
|
+
let h = n2 | 0;
|
|
436
|
+
if (h !== n2) {
|
|
437
|
+
h ^= n2 * 4294967295;
|
|
438
|
+
}
|
|
439
|
+
while (n2 > 4294967295) {
|
|
440
|
+
h ^= n2 /= 4294967295;
|
|
441
|
+
}
|
|
442
|
+
return optimize(n2);
|
|
443
|
+
};
|
|
444
|
+
var string = (str) => {
|
|
445
|
+
let h = 5381, i2 = str.length;
|
|
446
|
+
while (i2) {
|
|
447
|
+
h = h * 33 ^ str.charCodeAt(--i2);
|
|
448
|
+
}
|
|
449
|
+
return optimize(h);
|
|
450
|
+
};
|
|
451
|
+
var cached = function() {
|
|
452
|
+
if (arguments.length === 1) {
|
|
453
|
+
const self2 = arguments[0];
|
|
454
|
+
return function(hash3) {
|
|
455
|
+
Object.defineProperty(self2, symbol, {
|
|
456
|
+
value() {
|
|
457
|
+
return hash3;
|
|
458
|
+
},
|
|
459
|
+
enumerable: false
|
|
460
|
+
});
|
|
461
|
+
return hash3;
|
|
462
|
+
};
|
|
463
|
+
}
|
|
464
|
+
const self = arguments[0];
|
|
465
|
+
const hash2 = arguments[1];
|
|
466
|
+
Object.defineProperty(self, symbol, {
|
|
467
|
+
value() {
|
|
468
|
+
return hash2;
|
|
469
|
+
},
|
|
470
|
+
enumerable: false
|
|
471
|
+
});
|
|
472
|
+
return hash2;
|
|
473
|
+
};
|
|
474
|
+
|
|
475
|
+
// ../../../node_modules/.pnpm/effect@3.4.5/node_modules/effect/dist/esm/Equal.js
|
|
476
|
+
var symbol2 = /* @__PURE__ */ Symbol.for("effect/Equal");
|
|
477
|
+
function equals() {
|
|
478
|
+
if (arguments.length === 1) {
|
|
479
|
+
return (self) => compareBoth(self, arguments[0]);
|
|
480
|
+
}
|
|
481
|
+
return compareBoth(arguments[0], arguments[1]);
|
|
482
|
+
}
|
|
483
|
+
function compareBoth(self, that) {
|
|
484
|
+
if (self === that) {
|
|
485
|
+
return true;
|
|
486
|
+
}
|
|
487
|
+
const selfType = typeof self;
|
|
488
|
+
if (selfType !== typeof that) {
|
|
489
|
+
return false;
|
|
490
|
+
}
|
|
491
|
+
if (selfType === "object" || selfType === "function") {
|
|
492
|
+
if (self !== null && that !== null) {
|
|
493
|
+
if (isEqual(self) && isEqual(that)) {
|
|
494
|
+
if (hash(self) === hash(that) && self[symbol2](that)) {
|
|
495
|
+
return true;
|
|
496
|
+
} else {
|
|
497
|
+
return structuralRegionState.enabled && structuralRegionState.tester ? structuralRegionState.tester(self, that) : false;
|
|
498
|
+
}
|
|
499
|
+
} else if (self instanceof Date && that instanceof Date) {
|
|
500
|
+
return self.toISOString() === that.toISOString();
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
if (structuralRegionState.enabled) {
|
|
504
|
+
if (Array.isArray(self) && Array.isArray(that)) {
|
|
505
|
+
return self.length === that.length && self.every((v2, i2) => compareBoth(v2, that[i2]));
|
|
506
|
+
}
|
|
507
|
+
if (Object.getPrototypeOf(self) === Object.prototype && Object.getPrototypeOf(self) === Object.prototype) {
|
|
508
|
+
const keysSelf = Object.keys(self);
|
|
509
|
+
const keysThat = Object.keys(that);
|
|
510
|
+
if (keysSelf.length === keysThat.length) {
|
|
511
|
+
for (const key of keysSelf) {
|
|
512
|
+
if (!(key in that && compareBoth(self[key], that[key]))) {
|
|
513
|
+
return structuralRegionState.tester ? structuralRegionState.tester(self, that) : false;
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
return true;
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
return structuralRegionState.tester ? structuralRegionState.tester(self, that) : false;
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
return structuralRegionState.enabled && structuralRegionState.tester ? structuralRegionState.tester(self, that) : false;
|
|
523
|
+
}
|
|
524
|
+
var isEqual = (u2) => hasProperty(u2, symbol2);
|
|
525
|
+
var equivalence = () => equals;
|
|
526
|
+
|
|
527
|
+
// ../../../node_modules/.pnpm/effect@3.4.5/node_modules/effect/dist/esm/Inspectable.js
|
|
528
|
+
var NodeInspectSymbol = /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom");
|
|
529
|
+
var toJSON = (x2) => {
|
|
530
|
+
if (hasProperty(x2, "toJSON") && isFunction2(x2["toJSON"]) && x2["toJSON"].length === 0) {
|
|
531
|
+
return x2.toJSON();
|
|
532
|
+
} else if (Array.isArray(x2)) {
|
|
533
|
+
return x2.map(toJSON);
|
|
534
|
+
}
|
|
535
|
+
return x2;
|
|
536
|
+
};
|
|
537
|
+
var format = (x2) => JSON.stringify(x2, null, 2);
|
|
538
|
+
|
|
539
|
+
// ../../../node_modules/.pnpm/effect@3.4.5/node_modules/effect/dist/esm/Pipeable.js
|
|
540
|
+
var pipeArguments = (self, args) => {
|
|
541
|
+
switch (args.length) {
|
|
542
|
+
case 1:
|
|
543
|
+
return args[0](self);
|
|
544
|
+
case 2:
|
|
545
|
+
return args[1](args[0](self));
|
|
546
|
+
case 3:
|
|
547
|
+
return args[2](args[1](args[0](self)));
|
|
548
|
+
case 4:
|
|
549
|
+
return args[3](args[2](args[1](args[0](self))));
|
|
550
|
+
case 5:
|
|
551
|
+
return args[4](args[3](args[2](args[1](args[0](self)))));
|
|
552
|
+
case 6:
|
|
553
|
+
return args[5](args[4](args[3](args[2](args[1](args[0](self))))));
|
|
554
|
+
case 7:
|
|
555
|
+
return args[6](args[5](args[4](args[3](args[2](args[1](args[0](self)))))));
|
|
556
|
+
case 8:
|
|
557
|
+
return args[7](args[6](args[5](args[4](args[3](args[2](args[1](args[0](self))))))));
|
|
558
|
+
case 9:
|
|
559
|
+
return args[8](args[7](args[6](args[5](args[4](args[3](args[2](args[1](args[0](self)))))))));
|
|
560
|
+
default: {
|
|
561
|
+
let ret = self;
|
|
562
|
+
for (let i2 = 0, len = args.length; i2 < len; i2++) {
|
|
563
|
+
ret = args[i2](ret);
|
|
564
|
+
}
|
|
565
|
+
return ret;
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
};
|
|
569
|
+
|
|
570
|
+
// ../../../node_modules/.pnpm/effect@3.4.5/node_modules/effect/dist/esm/internal/effectable.js
|
|
571
|
+
var EffectTypeId = /* @__PURE__ */ Symbol.for("effect/Effect");
|
|
572
|
+
var StreamTypeId = /* @__PURE__ */ Symbol.for("effect/Stream");
|
|
573
|
+
var SinkTypeId = /* @__PURE__ */ Symbol.for("effect/Sink");
|
|
574
|
+
var ChannelTypeId = /* @__PURE__ */ Symbol.for("effect/Channel");
|
|
575
|
+
var effectVariance = {
|
|
576
|
+
/* c8 ignore next */
|
|
577
|
+
_R: (_2) => _2,
|
|
578
|
+
/* c8 ignore next */
|
|
579
|
+
_E: (_2) => _2,
|
|
580
|
+
/* c8 ignore next */
|
|
581
|
+
_A: (_2) => _2,
|
|
582
|
+
_V: /* @__PURE__ */ getCurrentVersion()
|
|
583
|
+
};
|
|
584
|
+
var sinkVariance = {
|
|
585
|
+
/* c8 ignore next */
|
|
586
|
+
_A: (_2) => _2,
|
|
587
|
+
/* c8 ignore next */
|
|
588
|
+
_In: (_2) => _2,
|
|
589
|
+
/* c8 ignore next */
|
|
590
|
+
_L: (_2) => _2,
|
|
591
|
+
/* c8 ignore next */
|
|
592
|
+
_E: (_2) => _2,
|
|
593
|
+
/* c8 ignore next */
|
|
594
|
+
_R: (_2) => _2
|
|
595
|
+
};
|
|
596
|
+
var channelVariance = {
|
|
597
|
+
/* c8 ignore next */
|
|
598
|
+
_Env: (_2) => _2,
|
|
599
|
+
/* c8 ignore next */
|
|
600
|
+
_InErr: (_2) => _2,
|
|
601
|
+
/* c8 ignore next */
|
|
602
|
+
_InElem: (_2) => _2,
|
|
603
|
+
/* c8 ignore next */
|
|
604
|
+
_InDone: (_2) => _2,
|
|
605
|
+
/* c8 ignore next */
|
|
606
|
+
_OutErr: (_2) => _2,
|
|
607
|
+
/* c8 ignore next */
|
|
608
|
+
_OutElem: (_2) => _2,
|
|
609
|
+
/* c8 ignore next */
|
|
610
|
+
_OutDone: (_2) => _2
|
|
611
|
+
};
|
|
612
|
+
var EffectPrototype = {
|
|
613
|
+
[EffectTypeId]: effectVariance,
|
|
614
|
+
[StreamTypeId]: effectVariance,
|
|
615
|
+
[SinkTypeId]: sinkVariance,
|
|
616
|
+
[ChannelTypeId]: channelVariance,
|
|
617
|
+
[symbol2](that) {
|
|
618
|
+
return this === that;
|
|
619
|
+
},
|
|
620
|
+
[symbol]() {
|
|
621
|
+
return cached(this, random(this));
|
|
622
|
+
},
|
|
623
|
+
[Symbol.iterator]() {
|
|
624
|
+
return new SingleShotGen(new YieldWrap(this));
|
|
625
|
+
},
|
|
626
|
+
pipe() {
|
|
627
|
+
return pipeArguments(this, arguments);
|
|
628
|
+
}
|
|
629
|
+
};
|
|
630
|
+
|
|
631
|
+
// ../../../node_modules/.pnpm/effect@3.4.5/node_modules/effect/dist/esm/internal/option.js
|
|
632
|
+
var TypeId = /* @__PURE__ */ Symbol.for("effect/Option");
|
|
633
|
+
var CommonProto = {
|
|
634
|
+
...EffectPrototype,
|
|
635
|
+
[TypeId]: {
|
|
636
|
+
_A: (_2) => _2
|
|
637
|
+
},
|
|
638
|
+
[NodeInspectSymbol]() {
|
|
639
|
+
return this.toJSON();
|
|
640
|
+
},
|
|
641
|
+
toString() {
|
|
642
|
+
return format(this.toJSON());
|
|
643
|
+
}
|
|
644
|
+
};
|
|
645
|
+
var SomeProto = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(CommonProto), {
|
|
646
|
+
_tag: "Some",
|
|
647
|
+
_op: "Some",
|
|
648
|
+
[symbol2](that) {
|
|
649
|
+
return isOption(that) && isSome(that) && equals(this.value, that.value);
|
|
650
|
+
},
|
|
651
|
+
[symbol]() {
|
|
652
|
+
return cached(this, combine(hash(this._tag))(hash(this.value)));
|
|
653
|
+
},
|
|
654
|
+
toJSON() {
|
|
655
|
+
return {
|
|
656
|
+
_id: "Option",
|
|
657
|
+
_tag: this._tag,
|
|
658
|
+
value: toJSON(this.value)
|
|
659
|
+
};
|
|
660
|
+
}
|
|
661
|
+
});
|
|
662
|
+
var NoneHash = /* @__PURE__ */ hash("None");
|
|
663
|
+
var NoneProto = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(CommonProto), {
|
|
664
|
+
_tag: "None",
|
|
665
|
+
_op: "None",
|
|
666
|
+
[symbol2](that) {
|
|
667
|
+
return isOption(that) && isNone(that);
|
|
668
|
+
},
|
|
669
|
+
[symbol]() {
|
|
670
|
+
return NoneHash;
|
|
671
|
+
},
|
|
672
|
+
toJSON() {
|
|
673
|
+
return {
|
|
674
|
+
_id: "Option",
|
|
675
|
+
_tag: this._tag
|
|
676
|
+
};
|
|
677
|
+
}
|
|
678
|
+
});
|
|
679
|
+
var isOption = (input) => hasProperty(input, TypeId);
|
|
680
|
+
var isNone = (fa) => fa._tag === "None";
|
|
681
|
+
var isSome = (fa) => fa._tag === "Some";
|
|
682
|
+
var none = /* @__PURE__ */ Object.create(NoneProto);
|
|
683
|
+
var some = (value) => {
|
|
684
|
+
const a = Object.create(SomeProto);
|
|
685
|
+
a.value = value;
|
|
686
|
+
return a;
|
|
687
|
+
};
|
|
688
|
+
|
|
689
|
+
// ../../../node_modules/.pnpm/effect@3.4.5/node_modules/effect/dist/esm/internal/either.js
|
|
690
|
+
var TypeId2 = /* @__PURE__ */ Symbol.for("effect/Either");
|
|
691
|
+
var CommonProto2 = {
|
|
692
|
+
...EffectPrototype,
|
|
693
|
+
[TypeId2]: {
|
|
694
|
+
_R: (_2) => _2
|
|
695
|
+
},
|
|
696
|
+
[NodeInspectSymbol]() {
|
|
697
|
+
return this.toJSON();
|
|
698
|
+
},
|
|
699
|
+
toString() {
|
|
700
|
+
return format(this.toJSON());
|
|
701
|
+
}
|
|
702
|
+
};
|
|
703
|
+
var RightProto = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(CommonProto2), {
|
|
704
|
+
_tag: "Right",
|
|
705
|
+
_op: "Right",
|
|
706
|
+
[symbol2](that) {
|
|
707
|
+
return isEither(that) && isRight(that) && equals(this.right, that.right);
|
|
708
|
+
},
|
|
709
|
+
[symbol]() {
|
|
710
|
+
return combine(hash(this._tag))(hash(this.right));
|
|
711
|
+
},
|
|
712
|
+
toJSON() {
|
|
713
|
+
return {
|
|
714
|
+
_id: "Either",
|
|
715
|
+
_tag: this._tag,
|
|
716
|
+
right: toJSON(this.right)
|
|
717
|
+
};
|
|
718
|
+
}
|
|
719
|
+
});
|
|
720
|
+
var LeftProto = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(CommonProto2), {
|
|
721
|
+
_tag: "Left",
|
|
722
|
+
_op: "Left",
|
|
723
|
+
[symbol2](that) {
|
|
724
|
+
return isEither(that) && isLeft(that) && equals(this.left, that.left);
|
|
725
|
+
},
|
|
726
|
+
[symbol]() {
|
|
727
|
+
return combine(hash(this._tag))(hash(this.left));
|
|
728
|
+
},
|
|
729
|
+
toJSON() {
|
|
730
|
+
return {
|
|
731
|
+
_id: "Either",
|
|
732
|
+
_tag: this._tag,
|
|
733
|
+
left: toJSON(this.left)
|
|
734
|
+
};
|
|
735
|
+
}
|
|
736
|
+
});
|
|
737
|
+
var isEither = (input) => hasProperty(input, TypeId2);
|
|
738
|
+
var isLeft = (ma) => ma._tag === "Left";
|
|
739
|
+
var isRight = (ma) => ma._tag === "Right";
|
|
740
|
+
var left = (left2) => {
|
|
741
|
+
const a = Object.create(LeftProto);
|
|
742
|
+
a.left = left2;
|
|
743
|
+
return a;
|
|
744
|
+
};
|
|
745
|
+
var right = (right2) => {
|
|
746
|
+
const a = Object.create(RightProto);
|
|
747
|
+
a.right = right2;
|
|
748
|
+
return a;
|
|
749
|
+
};
|
|
750
|
+
var getLeft = (self) => isRight(self) ? none : some(self.left);
|
|
751
|
+
var getRight = (self) => isLeft(self) ? none : some(self.right);
|
|
752
|
+
|
|
753
|
+
// ../../../node_modules/.pnpm/effect@3.4.5/node_modules/effect/dist/esm/Option.js
|
|
754
|
+
var Option_exports = {};
|
|
755
|
+
__export(Option_exports, {
|
|
756
|
+
Do: () => Do,
|
|
757
|
+
TypeId: () => TypeId3,
|
|
758
|
+
all: () => all,
|
|
759
|
+
andThen: () => andThen,
|
|
760
|
+
ap: () => ap,
|
|
761
|
+
as: () => as,
|
|
762
|
+
asVoid: () => asVoid,
|
|
763
|
+
bind: () => bind2,
|
|
764
|
+
bindTo: () => bindTo2,
|
|
765
|
+
composeK: () => composeK,
|
|
766
|
+
contains: () => contains,
|
|
767
|
+
containsWith: () => containsWith,
|
|
768
|
+
exists: () => exists,
|
|
769
|
+
filter: () => filter,
|
|
770
|
+
filterMap: () => filterMap,
|
|
771
|
+
firstSomeOf: () => firstSomeOf,
|
|
772
|
+
flatMap: () => flatMap,
|
|
773
|
+
flatMapNullable: () => flatMapNullable,
|
|
774
|
+
flatten: () => flatten,
|
|
775
|
+
fromIterable: () => fromIterable,
|
|
776
|
+
fromNullable: () => fromNullable,
|
|
777
|
+
gen: () => gen,
|
|
778
|
+
getEquivalence: () => getEquivalence,
|
|
779
|
+
getLeft: () => getLeft2,
|
|
780
|
+
getOrElse: () => getOrElse,
|
|
781
|
+
getOrNull: () => getOrNull,
|
|
782
|
+
getOrThrow: () => getOrThrow,
|
|
783
|
+
getOrThrowWith: () => getOrThrowWith,
|
|
784
|
+
getOrUndefined: () => getOrUndefined,
|
|
785
|
+
getOrder: () => getOrder,
|
|
786
|
+
getRight: () => getRight2,
|
|
787
|
+
isNone: () => isNone2,
|
|
788
|
+
isOption: () => isOption2,
|
|
789
|
+
isSome: () => isSome2,
|
|
790
|
+
let: () => let_2,
|
|
791
|
+
lift2: () => lift2,
|
|
792
|
+
liftNullable: () => liftNullable,
|
|
793
|
+
liftPredicate: () => liftPredicate,
|
|
794
|
+
liftThrowable: () => liftThrowable,
|
|
795
|
+
map: () => map,
|
|
796
|
+
match: () => match,
|
|
797
|
+
none: () => none2,
|
|
798
|
+
orElse: () => orElse,
|
|
799
|
+
orElseEither: () => orElseEither,
|
|
800
|
+
orElseSome: () => orElseSome,
|
|
801
|
+
partitionMap: () => partitionMap,
|
|
802
|
+
product: () => product,
|
|
803
|
+
productMany: () => productMany,
|
|
804
|
+
reduceCompact: () => reduceCompact,
|
|
805
|
+
some: () => some2,
|
|
806
|
+
tap: () => tap,
|
|
807
|
+
toArray: () => toArray,
|
|
808
|
+
toRefinement: () => toRefinement,
|
|
809
|
+
void: () => void_,
|
|
810
|
+
zipLeft: () => zipLeft,
|
|
811
|
+
zipRight: () => zipRight,
|
|
812
|
+
zipWith: () => zipWith
|
|
813
|
+
});
|
|
814
|
+
|
|
815
|
+
// ../../../node_modules/.pnpm/effect@3.4.5/node_modules/effect/dist/esm/Order.js
|
|
816
|
+
var make2 = (compare) => (self, that) => self === that ? 0 : compare(self, that);
|
|
817
|
+
|
|
818
|
+
// ../../../node_modules/.pnpm/effect@3.4.5/node_modules/effect/dist/esm/Option.js
|
|
819
|
+
var TypeId3 = /* @__PURE__ */ Symbol.for("effect/Option");
|
|
820
|
+
var none2 = () => none;
|
|
821
|
+
var some2 = some;
|
|
822
|
+
var isOption2 = isOption;
|
|
823
|
+
var isNone2 = isNone;
|
|
824
|
+
var isSome2 = isSome;
|
|
825
|
+
var match = /* @__PURE__ */ dual(2, (self, {
|
|
826
|
+
onNone,
|
|
827
|
+
onSome
|
|
828
|
+
}) => isNone2(self) ? onNone() : onSome(self.value));
|
|
829
|
+
var toRefinement = (f) => (a) => isSome2(f(a));
|
|
830
|
+
var fromIterable = (collection) => {
|
|
831
|
+
for (const a of collection) {
|
|
832
|
+
return some2(a);
|
|
833
|
+
}
|
|
834
|
+
return none2();
|
|
835
|
+
};
|
|
836
|
+
var getRight2 = getRight;
|
|
837
|
+
var getLeft2 = getLeft;
|
|
838
|
+
var getOrElse = /* @__PURE__ */ dual(2, (self, onNone) => isNone2(self) ? onNone() : self.value);
|
|
839
|
+
var orElse = /* @__PURE__ */ dual(2, (self, that) => isNone2(self) ? that() : self);
|
|
840
|
+
var orElseSome = /* @__PURE__ */ dual(2, (self, onNone) => isNone2(self) ? some2(onNone()) : self);
|
|
841
|
+
var orElseEither = /* @__PURE__ */ dual(2, (self, that) => isNone2(self) ? map(that(), right) : map(self, left));
|
|
842
|
+
var firstSomeOf = (collection) => {
|
|
843
|
+
let out = none2();
|
|
844
|
+
for (out of collection) {
|
|
845
|
+
if (isSome2(out)) {
|
|
846
|
+
return out;
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
return out;
|
|
850
|
+
};
|
|
851
|
+
var fromNullable = (nullableValue) => nullableValue == null ? none2() : some2(nullableValue);
|
|
852
|
+
var liftNullable = (f) => (...a) => fromNullable(f(...a));
|
|
853
|
+
var getOrNull = /* @__PURE__ */ getOrElse(constNull);
|
|
854
|
+
var getOrUndefined = /* @__PURE__ */ getOrElse(constUndefined);
|
|
855
|
+
var liftThrowable = (f) => (...a) => {
|
|
856
|
+
try {
|
|
857
|
+
return some2(f(...a));
|
|
858
|
+
} catch (e2) {
|
|
859
|
+
return none2();
|
|
860
|
+
}
|
|
861
|
+
};
|
|
862
|
+
var getOrThrowWith = /* @__PURE__ */ dual(2, (self, onNone) => {
|
|
863
|
+
if (isSome2(self)) {
|
|
864
|
+
return self.value;
|
|
865
|
+
}
|
|
866
|
+
throw onNone();
|
|
867
|
+
});
|
|
868
|
+
var getOrThrow = /* @__PURE__ */ getOrThrowWith(() => new Error("getOrThrow called on a None"));
|
|
869
|
+
var map = /* @__PURE__ */ dual(2, (self, f) => isNone2(self) ? none2() : some2(f(self.value)));
|
|
870
|
+
var as = /* @__PURE__ */ dual(2, (self, b2) => map(self, () => b2));
|
|
871
|
+
var asVoid = /* @__PURE__ */ as(void 0);
|
|
872
|
+
var void_ = /* @__PURE__ */ some2(void 0);
|
|
873
|
+
var flatMap = /* @__PURE__ */ dual(2, (self, f) => isNone2(self) ? none2() : f(self.value));
|
|
874
|
+
var andThen = /* @__PURE__ */ dual(2, (self, f) => flatMap(self, (a) => {
|
|
875
|
+
const b2 = isFunction(f) ? f(a) : f;
|
|
876
|
+
return isOption2(b2) ? b2 : some2(b2);
|
|
877
|
+
}));
|
|
878
|
+
var flatMapNullable = /* @__PURE__ */ dual(2, (self, f) => isNone2(self) ? none2() : fromNullable(f(self.value)));
|
|
879
|
+
var flatten = /* @__PURE__ */ flatMap(identity);
|
|
880
|
+
var zipRight = /* @__PURE__ */ dual(2, (self, that) => flatMap(self, () => that));
|
|
881
|
+
var composeK = /* @__PURE__ */ dual(2, (afb, bfc) => (a) => flatMap(afb(a), bfc));
|
|
882
|
+
var zipLeft = /* @__PURE__ */ dual(2, (self, that) => tap(self, () => that));
|
|
883
|
+
var tap = /* @__PURE__ */ dual(2, (self, f) => flatMap(self, (a) => map(f(a), () => a)));
|
|
884
|
+
var product = (self, that) => isSome2(self) && isSome2(that) ? some2([self.value, that.value]) : none2();
|
|
885
|
+
var productMany = (self, collection) => {
|
|
886
|
+
if (isNone2(self)) {
|
|
887
|
+
return none2();
|
|
888
|
+
}
|
|
889
|
+
const out = [self.value];
|
|
890
|
+
for (const o2 of collection) {
|
|
891
|
+
if (isNone2(o2)) {
|
|
892
|
+
return none2();
|
|
893
|
+
}
|
|
894
|
+
out.push(o2.value);
|
|
895
|
+
}
|
|
896
|
+
return some2(out);
|
|
897
|
+
};
|
|
898
|
+
var all = (input) => {
|
|
899
|
+
if (Symbol.iterator in input) {
|
|
900
|
+
const out2 = [];
|
|
901
|
+
for (const o2 of input) {
|
|
902
|
+
if (isNone2(o2)) {
|
|
903
|
+
return none2();
|
|
904
|
+
}
|
|
905
|
+
out2.push(o2.value);
|
|
906
|
+
}
|
|
907
|
+
return some2(out2);
|
|
908
|
+
}
|
|
909
|
+
const out = {};
|
|
910
|
+
for (const key of Object.keys(input)) {
|
|
911
|
+
const o2 = input[key];
|
|
912
|
+
if (isNone2(o2)) {
|
|
913
|
+
return none2();
|
|
914
|
+
}
|
|
915
|
+
out[key] = o2.value;
|
|
916
|
+
}
|
|
917
|
+
return some2(out);
|
|
918
|
+
};
|
|
919
|
+
var zipWith = /* @__PURE__ */ dual(3, (self, that, f) => map(product(self, that), ([a, b2]) => f(a, b2)));
|
|
920
|
+
var ap = /* @__PURE__ */ dual(2, (self, that) => zipWith(self, that, (f, a) => f(a)));
|
|
921
|
+
var reduceCompact = /* @__PURE__ */ dual(3, (self, b2, f) => {
|
|
922
|
+
let out = b2;
|
|
923
|
+
for (const oa of self) {
|
|
924
|
+
if (isSome2(oa)) {
|
|
925
|
+
out = f(out, oa.value);
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
return out;
|
|
929
|
+
});
|
|
930
|
+
var toArray = (self) => isNone2(self) ? [] : [self.value];
|
|
931
|
+
var partitionMap = /* @__PURE__ */ dual(2, (self, f) => {
|
|
932
|
+
if (isNone2(self)) {
|
|
933
|
+
return [none2(), none2()];
|
|
934
|
+
}
|
|
935
|
+
const e2 = f(self.value);
|
|
936
|
+
return isLeft(e2) ? [some2(e2.left), none2()] : [none2(), some2(e2.right)];
|
|
937
|
+
});
|
|
938
|
+
var filterMap = /* @__PURE__ */ dual(2, (self, f) => isNone2(self) ? none2() : f(self.value));
|
|
939
|
+
var filter = /* @__PURE__ */ dual(2, (self, predicate) => filterMap(self, (b2) => predicate(b2) ? some(b2) : none));
|
|
940
|
+
var getEquivalence = (isEquivalent) => make((x2, y2) => isNone2(x2) ? isNone2(y2) : isNone2(y2) ? false : isEquivalent(x2.value, y2.value));
|
|
941
|
+
var getOrder = (O) => make2((self, that) => isSome2(self) ? isSome2(that) ? O(self.value, that.value) : 1 : -1);
|
|
942
|
+
var lift2 = (f) => dual(2, (self, that) => zipWith(self, that, f));
|
|
943
|
+
var liftPredicate = /* @__PURE__ */ dual(2, (b2, predicate) => predicate(b2) ? some2(b2) : none2());
|
|
944
|
+
var containsWith = (isEquivalent) => dual(2, (self, a) => isNone2(self) ? false : isEquivalent(self.value, a));
|
|
945
|
+
var _equivalence = /* @__PURE__ */ equivalence();
|
|
946
|
+
var contains = /* @__PURE__ */ containsWith(_equivalence);
|
|
947
|
+
var exists = /* @__PURE__ */ dual(2, (self, refinement) => isNone2(self) ? false : refinement(self.value));
|
|
948
|
+
var bindTo2 = /* @__PURE__ */ bindTo(map);
|
|
949
|
+
var let_2 = /* @__PURE__ */ let_(map);
|
|
950
|
+
var bind2 = /* @__PURE__ */ bind(map, flatMap);
|
|
951
|
+
var Do = /* @__PURE__ */ some2({});
|
|
952
|
+
var adapter2 = /* @__PURE__ */ adapter();
|
|
953
|
+
var gen = (...args) => {
|
|
954
|
+
let f;
|
|
955
|
+
if (args.length === 1) {
|
|
956
|
+
f = args[0];
|
|
957
|
+
} else {
|
|
958
|
+
f = args[1].bind(args[0]);
|
|
959
|
+
}
|
|
960
|
+
const iterator = f(adapter2);
|
|
961
|
+
let state = iterator.next();
|
|
962
|
+
if (state.done) {
|
|
963
|
+
return some2(state.value);
|
|
964
|
+
} else {
|
|
965
|
+
let current = state.value;
|
|
966
|
+
if (isGenKind(current)) {
|
|
967
|
+
current = current.value;
|
|
968
|
+
} else {
|
|
969
|
+
current = yieldWrapGet(current);
|
|
970
|
+
}
|
|
971
|
+
if (isNone2(current)) {
|
|
972
|
+
return current;
|
|
973
|
+
}
|
|
974
|
+
while (!state.done) {
|
|
975
|
+
state = iterator.next(current.value);
|
|
976
|
+
if (!state.done) {
|
|
977
|
+
current = state.value;
|
|
978
|
+
if (isGenKind(current)) {
|
|
979
|
+
current = current.value;
|
|
980
|
+
} else {
|
|
981
|
+
current = yieldWrapGet(current);
|
|
982
|
+
}
|
|
983
|
+
if (isNone2(current)) {
|
|
984
|
+
return current;
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
return some2(state.value);
|
|
989
|
+
}
|
|
990
|
+
};
|
|
991
|
+
|
|
50
992
|
// ../../../node_modules/.pnpm/ts-pattern@5.2.0/node_modules/ts-pattern/dist/index.js
|
|
51
993
|
var t = Symbol.for("@ts-pattern/matcher");
|
|
52
994
|
var e = Symbol.for("@ts-pattern/isVariadic");
|
|
@@ -216,6 +1158,45 @@ var z = class _z {
|
|
|
216
1158
|
return this;
|
|
217
1159
|
}
|
|
218
1160
|
};
|
|
1161
|
+
|
|
1162
|
+
// ../../../node_modules/.pnpm/valibot@0.35.0/node_modules/valibot/dist/index.js
|
|
1163
|
+
var store;
|
|
1164
|
+
function getGlobalConfig(config2) {
|
|
1165
|
+
return {
|
|
1166
|
+
lang: config2?.lang ?? store?.lang,
|
|
1167
|
+
message: config2?.message,
|
|
1168
|
+
abortEarly: config2?.abortEarly ?? store?.abortEarly,
|
|
1169
|
+
abortPipeEarly: config2?.abortPipeEarly ?? store?.abortPipeEarly
|
|
1170
|
+
};
|
|
1171
|
+
}
|
|
1172
|
+
var ValiError = class extends Error {
|
|
1173
|
+
/**
|
|
1174
|
+
* The error issues.
|
|
1175
|
+
*/
|
|
1176
|
+
issues;
|
|
1177
|
+
/**
|
|
1178
|
+
* Creates a Valibot error with useful information.
|
|
1179
|
+
*
|
|
1180
|
+
* @param issues The error issues.
|
|
1181
|
+
*/
|
|
1182
|
+
constructor(issues) {
|
|
1183
|
+
super(issues[0].message);
|
|
1184
|
+
this.name = "ValiError";
|
|
1185
|
+
this.issues = issues;
|
|
1186
|
+
}
|
|
1187
|
+
};
|
|
1188
|
+
function parse(schema, input, config2) {
|
|
1189
|
+
const dataset = schema._run(
|
|
1190
|
+
{ typed: false, value: input },
|
|
1191
|
+
getGlobalConfig(config2)
|
|
1192
|
+
);
|
|
1193
|
+
if (dataset.issues) {
|
|
1194
|
+
throw new ValiError(dataset.issues);
|
|
1195
|
+
}
|
|
1196
|
+
return dataset.value;
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
// src/rules/ensure-use-callback-has-non-empty-deps.ts
|
|
219
1200
|
var RULE_NAME2 = "ensure-use-callback-has-non-empty-deps";
|
|
220
1201
|
var ensure_use_callback_has_non_empty_deps_default = createRule({
|
|
221
1202
|
meta: {
|
|
@@ -236,7 +1217,7 @@ var ensure_use_callback_has_non_empty_deps_default = createRule({
|
|
|
236
1217
|
CallExpression(node) {
|
|
237
1218
|
const initialScope = context.sourceCode.getScope(node);
|
|
238
1219
|
if (!isReactHookCall(node)) return;
|
|
239
|
-
if (!isUseCallbackCall(node, context) && !alias.some(
|
|
1220
|
+
if (!isUseCallbackCall(node, context) && !alias.some(Function_exports.flip(isReactHookCallWithNameLoose)(node))) {
|
|
240
1221
|
return;
|
|
241
1222
|
}
|
|
242
1223
|
const [_2, deps] = node.arguments;
|
|
@@ -247,21 +1228,21 @@ var ensure_use_callback_has_non_empty_deps_default = createRule({
|
|
|
247
1228
|
});
|
|
248
1229
|
return;
|
|
249
1230
|
}
|
|
250
|
-
const maybeDescriptor =
|
|
251
|
-
$(deps).with({ type: NodeType.ArrayExpression },
|
|
252
|
-
return
|
|
1231
|
+
const maybeDescriptor = Function_exports.pipe(
|
|
1232
|
+
$(deps).with({ type: NodeType.ArrayExpression }, Option_exports.some).with({ type: NodeType.Identifier }, (n2) => {
|
|
1233
|
+
return Function_exports.pipe(
|
|
253
1234
|
findVariable(n2.name, initialScope),
|
|
254
|
-
|
|
255
|
-
|
|
1235
|
+
Option_exports.flatMap(getVariableInit(0)),
|
|
1236
|
+
Option_exports.filter(is(NodeType.ArrayExpression))
|
|
256
1237
|
);
|
|
257
|
-
}).otherwise(
|
|
258
|
-
|
|
259
|
-
|
|
1238
|
+
}).otherwise(Option_exports.none),
|
|
1239
|
+
Option_exports.filter((x2) => x2.elements.length === 0),
|
|
1240
|
+
Option_exports.map(() => ({
|
|
260
1241
|
messageId: "ENSURE_USE_CALLBACK_HAS_NON_EMPTY_DEPS",
|
|
261
1242
|
node
|
|
262
1243
|
}))
|
|
263
1244
|
);
|
|
264
|
-
|
|
1245
|
+
Option_exports.map(maybeDescriptor, context.report);
|
|
265
1246
|
}
|
|
266
1247
|
};
|
|
267
1248
|
},
|
|
@@ -287,7 +1268,7 @@ var ensure_use_memo_has_non_empty_deps_default = createRule({
|
|
|
287
1268
|
CallExpression(node) {
|
|
288
1269
|
const initialScope = context.sourceCode.getScope(node);
|
|
289
1270
|
if (!isReactHookCall(node)) return;
|
|
290
|
-
if (!isUseMemoCall(node, context) && !alias.some(
|
|
1271
|
+
if (!isUseMemoCall(node, context) && !alias.some(Function_exports.flip(isReactHookCallWithNameLoose)(node))) return;
|
|
291
1272
|
const [_2, deps] = node.arguments;
|
|
292
1273
|
if (!deps) {
|
|
293
1274
|
context.report({
|
|
@@ -296,21 +1277,21 @@ var ensure_use_memo_has_non_empty_deps_default = createRule({
|
|
|
296
1277
|
});
|
|
297
1278
|
return;
|
|
298
1279
|
}
|
|
299
|
-
const maybeDescriptor =
|
|
300
|
-
$(deps).with({ type: NodeType.ArrayExpression },
|
|
301
|
-
return
|
|
1280
|
+
const maybeDescriptor = Function_exports.pipe(
|
|
1281
|
+
$(deps).with({ type: NodeType.ArrayExpression }, Option_exports.some).with({ type: NodeType.Identifier }, (n2) => {
|
|
1282
|
+
return Function_exports.pipe(
|
|
302
1283
|
findVariable(n2.name, initialScope),
|
|
303
|
-
|
|
304
|
-
|
|
1284
|
+
Option_exports.flatMap(getVariableInit(0)),
|
|
1285
|
+
Option_exports.filter(is(NodeType.ArrayExpression))
|
|
305
1286
|
);
|
|
306
|
-
}).otherwise(
|
|
307
|
-
|
|
308
|
-
|
|
1287
|
+
}).otherwise(Option_exports.none),
|
|
1288
|
+
Option_exports.filter((x2) => x2.elements.length === 0),
|
|
1289
|
+
Option_exports.map(() => ({
|
|
309
1290
|
messageId: "ENSURE_USE_MEMO_HAS_NON_EMPTY_DEPS",
|
|
310
1291
|
node
|
|
311
1292
|
}))
|
|
312
1293
|
);
|
|
313
|
-
|
|
1294
|
+
Option_exports.map(maybeDescriptor, context.report);
|
|
314
1295
|
}
|
|
315
1296
|
};
|
|
316
1297
|
},
|
|
@@ -336,7 +1317,7 @@ var prefer_use_state_lazy_initialization_default = createRule({
|
|
|
336
1317
|
return {
|
|
337
1318
|
CallExpression(node) {
|
|
338
1319
|
if (!isReactHookCall(node)) return;
|
|
339
|
-
if (!isUseStateCall(node, context) && !alias.some(
|
|
1320
|
+
if (!isUseStateCall(node, context) && !alias.some(Function_exports.flip(isReactHookCallWithNameLoose)(node))) return;
|
|
340
1321
|
const [useStateInput] = node.arguments;
|
|
341
1322
|
if (!useStateInput) return;
|
|
342
1323
|
const nestedCallExpressions = getNestedCallExpressions(useStateInput);
|