eslint-plugin-react-hooks-extra 1.5.18 → 1.5.19-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 +1008 -27
- package/dist/index.mjs +1005 -24
- package/package.json +12 -12
package/dist/index.js
CHANGED
|
@@ -4,12 +4,16 @@ 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
|
|
7
|
+
|
|
8
|
+
var __defProp = Object.defineProperty;
|
|
9
|
+
var __export = (target, all2) => {
|
|
10
|
+
for (var name2 in all2)
|
|
11
|
+
__defProp(target, name2, { get: all2[name2], enumerable: true });
|
|
12
|
+
};
|
|
9
13
|
|
|
10
14
|
// package.json
|
|
11
15
|
var name = "eslint-plugin-react-hooks-extra";
|
|
12
|
-
var version = "1.5.
|
|
16
|
+
var version = "1.5.19-next.0";
|
|
13
17
|
var createRule = shared.createRuleForPlugin("hooks-extra");
|
|
14
18
|
|
|
15
19
|
// src/rules/ensure-custom-hooks-using-other-hooks.ts
|
|
@@ -49,6 +53,944 @@ var ensure_custom_hooks_using_other_hooks_default = createRule({
|
|
|
49
53
|
defaultOptions: []
|
|
50
54
|
});
|
|
51
55
|
|
|
56
|
+
// ../../../node_modules/.pnpm/effect@3.4.5/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.5/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.5/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.5/node_modules/effect/dist/esm/internal/version.js
|
|
246
|
+
var moduleVersion = "3.4.5";
|
|
247
|
+
var getCurrentVersion = () => moduleVersion;
|
|
248
|
+
|
|
249
|
+
// ../../../node_modules/.pnpm/effect@3.4.5/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.5/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.5/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.5/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.5/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.5/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.5/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.5/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.5/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.5/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.5/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.5/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.5/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.5/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
|
+
|
|
52
994
|
// ../../../node_modules/.pnpm/ts-pattern@5.2.0/node_modules/ts-pattern/dist/index.js
|
|
53
995
|
var t = Symbol.for("@ts-pattern/matcher");
|
|
54
996
|
var e = Symbol.for("@ts-pattern/isVariadic");
|
|
@@ -218,6 +1160,45 @@ var z = class _z {
|
|
|
218
1160
|
return this;
|
|
219
1161
|
}
|
|
220
1162
|
};
|
|
1163
|
+
|
|
1164
|
+
// ../../../node_modules/.pnpm/valibot@0.35.0/node_modules/valibot/dist/index.js
|
|
1165
|
+
var store;
|
|
1166
|
+
function getGlobalConfig(config2) {
|
|
1167
|
+
return {
|
|
1168
|
+
lang: config2?.lang ?? store?.lang,
|
|
1169
|
+
message: config2?.message,
|
|
1170
|
+
abortEarly: config2?.abortEarly ?? store?.abortEarly,
|
|
1171
|
+
abortPipeEarly: config2?.abortPipeEarly ?? store?.abortPipeEarly
|
|
1172
|
+
};
|
|
1173
|
+
}
|
|
1174
|
+
var ValiError = class extends Error {
|
|
1175
|
+
/**
|
|
1176
|
+
* The error issues.
|
|
1177
|
+
*/
|
|
1178
|
+
issues;
|
|
1179
|
+
/**
|
|
1180
|
+
* Creates a Valibot error with useful information.
|
|
1181
|
+
*
|
|
1182
|
+
* @param issues The error issues.
|
|
1183
|
+
*/
|
|
1184
|
+
constructor(issues) {
|
|
1185
|
+
super(issues[0].message);
|
|
1186
|
+
this.name = "ValiError";
|
|
1187
|
+
this.issues = issues;
|
|
1188
|
+
}
|
|
1189
|
+
};
|
|
1190
|
+
function parse(schema, input, config2) {
|
|
1191
|
+
const dataset = schema._run(
|
|
1192
|
+
{ typed: false, value: input },
|
|
1193
|
+
getGlobalConfig(config2)
|
|
1194
|
+
);
|
|
1195
|
+
if (dataset.issues) {
|
|
1196
|
+
throw new ValiError(dataset.issues);
|
|
1197
|
+
}
|
|
1198
|
+
return dataset.value;
|
|
1199
|
+
}
|
|
1200
|
+
|
|
1201
|
+
// src/rules/ensure-use-callback-has-non-empty-deps.ts
|
|
221
1202
|
var RULE_NAME2 = "ensure-use-callback-has-non-empty-deps";
|
|
222
1203
|
var ensure_use_callback_has_non_empty_deps_default = createRule({
|
|
223
1204
|
meta: {
|
|
@@ -233,12 +1214,12 @@ var ensure_use_callback_has_non_empty_deps_default = createRule({
|
|
|
233
1214
|
},
|
|
234
1215
|
name: RULE_NAME2,
|
|
235
1216
|
create(context) {
|
|
236
|
-
const alias =
|
|
1217
|
+
const alias = parse(shared.ESLintSettingsSchema, context.settings).reactOptions?.additionalHooks?.useCallback ?? [];
|
|
237
1218
|
return {
|
|
238
1219
|
CallExpression(node) {
|
|
239
1220
|
const initialScope = context.sourceCode.getScope(node);
|
|
240
1221
|
if (!core.isReactHookCall(node)) return;
|
|
241
|
-
if (!core.isUseCallbackCall(node, context) && !alias.some(
|
|
1222
|
+
if (!core.isUseCallbackCall(node, context) && !alias.some(Function_exports.flip(core.isReactHookCallWithNameLoose)(node))) {
|
|
242
1223
|
return;
|
|
243
1224
|
}
|
|
244
1225
|
const [_2, deps] = node.arguments;
|
|
@@ -249,21 +1230,21 @@ var ensure_use_callback_has_non_empty_deps_default = createRule({
|
|
|
249
1230
|
});
|
|
250
1231
|
return;
|
|
251
1232
|
}
|
|
252
|
-
const maybeDescriptor =
|
|
253
|
-
$(deps).with({ type: ast.NodeType.ArrayExpression },
|
|
254
|
-
return
|
|
1233
|
+
const maybeDescriptor = Function_exports.pipe(
|
|
1234
|
+
$(deps).with({ type: ast.NodeType.ArrayExpression }, Option_exports.some).with({ type: ast.NodeType.Identifier }, (n2) => {
|
|
1235
|
+
return Function_exports.pipe(
|
|
255
1236
|
_var.findVariable(n2.name, initialScope),
|
|
256
|
-
|
|
257
|
-
|
|
1237
|
+
Option_exports.flatMap(_var.getVariableInit(0)),
|
|
1238
|
+
Option_exports.filter(ast.is(ast.NodeType.ArrayExpression))
|
|
258
1239
|
);
|
|
259
|
-
}).otherwise(
|
|
260
|
-
|
|
261
|
-
|
|
1240
|
+
}).otherwise(Option_exports.none),
|
|
1241
|
+
Option_exports.filter((x2) => x2.elements.length === 0),
|
|
1242
|
+
Option_exports.map(() => ({
|
|
262
1243
|
messageId: "ENSURE_USE_CALLBACK_HAS_NON_EMPTY_DEPS",
|
|
263
1244
|
node
|
|
264
1245
|
}))
|
|
265
1246
|
);
|
|
266
|
-
|
|
1247
|
+
Option_exports.map(maybeDescriptor, context.report);
|
|
267
1248
|
}
|
|
268
1249
|
};
|
|
269
1250
|
},
|
|
@@ -284,12 +1265,12 @@ var ensure_use_memo_has_non_empty_deps_default = createRule({
|
|
|
284
1265
|
},
|
|
285
1266
|
name: RULE_NAME3,
|
|
286
1267
|
create(context) {
|
|
287
|
-
const alias =
|
|
1268
|
+
const alias = parse(shared.ESLintSettingsSchema, context.settings).reactOptions?.additionalHooks?.useMemo ?? [];
|
|
288
1269
|
return {
|
|
289
1270
|
CallExpression(node) {
|
|
290
1271
|
const initialScope = context.sourceCode.getScope(node);
|
|
291
1272
|
if (!core.isReactHookCall(node)) return;
|
|
292
|
-
if (!core.isUseMemoCall(node, context) && !alias.some(
|
|
1273
|
+
if (!core.isUseMemoCall(node, context) && !alias.some(Function_exports.flip(core.isReactHookCallWithNameLoose)(node))) return;
|
|
293
1274
|
const [_2, deps] = node.arguments;
|
|
294
1275
|
if (!deps) {
|
|
295
1276
|
context.report({
|
|
@@ -298,21 +1279,21 @@ var ensure_use_memo_has_non_empty_deps_default = createRule({
|
|
|
298
1279
|
});
|
|
299
1280
|
return;
|
|
300
1281
|
}
|
|
301
|
-
const maybeDescriptor =
|
|
302
|
-
$(deps).with({ type: ast.NodeType.ArrayExpression },
|
|
303
|
-
return
|
|
1282
|
+
const maybeDescriptor = Function_exports.pipe(
|
|
1283
|
+
$(deps).with({ type: ast.NodeType.ArrayExpression }, Option_exports.some).with({ type: ast.NodeType.Identifier }, (n2) => {
|
|
1284
|
+
return Function_exports.pipe(
|
|
304
1285
|
_var.findVariable(n2.name, initialScope),
|
|
305
|
-
|
|
306
|
-
|
|
1286
|
+
Option_exports.flatMap(_var.getVariableInit(0)),
|
|
1287
|
+
Option_exports.filter(ast.is(ast.NodeType.ArrayExpression))
|
|
307
1288
|
);
|
|
308
|
-
}).otherwise(
|
|
309
|
-
|
|
310
|
-
|
|
1289
|
+
}).otherwise(Option_exports.none),
|
|
1290
|
+
Option_exports.filter((x2) => x2.elements.length === 0),
|
|
1291
|
+
Option_exports.map(() => ({
|
|
311
1292
|
messageId: "ENSURE_USE_MEMO_HAS_NON_EMPTY_DEPS",
|
|
312
1293
|
node
|
|
313
1294
|
}))
|
|
314
1295
|
);
|
|
315
|
-
|
|
1296
|
+
Option_exports.map(maybeDescriptor, context.report);
|
|
316
1297
|
}
|
|
317
1298
|
};
|
|
318
1299
|
},
|
|
@@ -334,11 +1315,11 @@ var prefer_use_state_lazy_initialization_default = createRule({
|
|
|
334
1315
|
},
|
|
335
1316
|
name: RULE_NAME4,
|
|
336
1317
|
create(context) {
|
|
337
|
-
const alias =
|
|
1318
|
+
const alias = parse(shared.ESLintSettingsSchema, context.settings).reactOptions?.additionalHooks?.useState ?? [];
|
|
338
1319
|
return {
|
|
339
1320
|
CallExpression(node) {
|
|
340
1321
|
if (!core.isReactHookCall(node)) return;
|
|
341
|
-
if (!core.isUseStateCall(node, context) && !alias.some(
|
|
1322
|
+
if (!core.isUseStateCall(node, context) && !alias.some(Function_exports.flip(core.isReactHookCallWithNameLoose)(node))) return;
|
|
342
1323
|
const [useStateInput] = node.arguments;
|
|
343
1324
|
if (!useStateInput) return;
|
|
344
1325
|
const nestedCallExpressions = ast.getNestedCallExpressions(useStateInput);
|