eslint-plugin-react-naming-convention
Advanced tools
Comparing version
1703
dist/index.js
@@ -7,14 +7,1331 @@ 'use strict'; | ||
var shared = require('@eslint-react/shared'); | ||
var effect = require('effect'); | ||
var tsPattern = require('ts-pattern'); | ||
var path = require('pathe'); | ||
var stringTs = require('string-ts'); | ||
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; } | ||
var __defProp = Object.defineProperty; | ||
var __export = (target, all3) => { | ||
for (var name2 in all3) | ||
__defProp(target, name2, { get: all3[name2], enumerable: true }); | ||
}; | ||
var path__default = /*#__PURE__*/_interopDefault(path); | ||
// package.json | ||
var name = "eslint-plugin-react-naming-convention"; | ||
var version = "1.5.21-next.0"; | ||
var version = "1.5.21-next.1"; | ||
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Function.js | ||
var Function_exports = {}; | ||
__export(Function_exports, { | ||
SK: () => SK, | ||
absurd: () => absurd, | ||
apply: () => apply, | ||
compose: () => compose, | ||
constFalse: () => constFalse, | ||
constNull: () => constNull, | ||
constTrue: () => constTrue, | ||
constUndefined: () => constUndefined, | ||
constVoid: () => constVoid, | ||
constant: () => constant, | ||
dual: () => dual, | ||
flip: () => flip, | ||
flow: () => flow, | ||
hole: () => hole, | ||
identity: () => identity, | ||
isFunction: () => isFunction, | ||
pipe: () => pipe, | ||
satisfies: () => satisfies, | ||
tupled: () => tupled, | ||
unsafeCoerce: () => unsafeCoerce, | ||
untupled: () => untupled | ||
}); | ||
var isFunction = (input) => typeof input === "function"; | ||
var dual = function(arity, body) { | ||
if (typeof arity === "function") { | ||
return function() { | ||
if (arity(arguments)) { | ||
return body.apply(this, arguments); | ||
} | ||
return (self) => body(self, ...arguments); | ||
}; | ||
} | ||
switch (arity) { | ||
case 0: | ||
case 1: | ||
throw new RangeError(`Invalid arity ${arity}`); | ||
case 2: | ||
return function(a, b2) { | ||
if (arguments.length >= 2) { | ||
return body(a, b2); | ||
} | ||
return function(self) { | ||
return body(self, a); | ||
}; | ||
}; | ||
case 3: | ||
return function(a, b2, c2) { | ||
if (arguments.length >= 3) { | ||
return body(a, b2, c2); | ||
} | ||
return function(self) { | ||
return body(self, a, b2); | ||
}; | ||
}; | ||
case 4: | ||
return function(a, b2, c2, d2) { | ||
if (arguments.length >= 4) { | ||
return body(a, b2, c2, d2); | ||
} | ||
return function(self) { | ||
return body(self, a, b2, c2); | ||
}; | ||
}; | ||
case 5: | ||
return function(a, b2, c2, d2, e2) { | ||
if (arguments.length >= 5) { | ||
return body(a, b2, c2, d2, e2); | ||
} | ||
return function(self) { | ||
return body(self, a, b2, c2, d2); | ||
}; | ||
}; | ||
default: | ||
return function() { | ||
if (arguments.length >= arity) { | ||
return body.apply(this, arguments); | ||
} | ||
const args = arguments; | ||
return function(self) { | ||
return body(self, ...args); | ||
}; | ||
}; | ||
} | ||
}; | ||
var apply = (a) => (self) => self(a); | ||
var identity = (a) => a; | ||
var satisfies = () => (b2) => b2; | ||
var unsafeCoerce = identity; | ||
var constant = (value) => () => value; | ||
var constTrue = /* @__PURE__ */ constant(true); | ||
var constFalse = /* @__PURE__ */ constant(false); | ||
var constNull = /* @__PURE__ */ constant(null); | ||
var constUndefined = /* @__PURE__ */ constant(void 0); | ||
var constVoid = constUndefined; | ||
var flip = (f) => (...b2) => (...a) => f(...a)(...b2); | ||
var compose = /* @__PURE__ */ dual(2, (ab, bc) => (a) => bc(ab(a))); | ||
var absurd = (_2) => { | ||
throw new Error("Called `absurd` function which should be uncallable"); | ||
}; | ||
var tupled = (f) => (a) => f(...a); | ||
var untupled = (f) => (...a) => f(a); | ||
function pipe(a, ab, bc, cd, de, ef, fg, gh, hi) { | ||
switch (arguments.length) { | ||
case 1: | ||
return a; | ||
case 2: | ||
return ab(a); | ||
case 3: | ||
return bc(ab(a)); | ||
case 4: | ||
return cd(bc(ab(a))); | ||
case 5: | ||
return de(cd(bc(ab(a)))); | ||
case 6: | ||
return ef(de(cd(bc(ab(a))))); | ||
case 7: | ||
return fg(ef(de(cd(bc(ab(a)))))); | ||
case 8: | ||
return gh(fg(ef(de(cd(bc(ab(a))))))); | ||
case 9: | ||
return hi(gh(fg(ef(de(cd(bc(ab(a)))))))); | ||
default: { | ||
let ret = arguments[0]; | ||
for (let i2 = 1; i2 < arguments.length; i2++) { | ||
ret = arguments[i2](ret); | ||
} | ||
return ret; | ||
} | ||
} | ||
} | ||
function flow(ab, bc, cd, de, ef, fg, gh, hi, ij) { | ||
switch (arguments.length) { | ||
case 1: | ||
return ab; | ||
case 2: | ||
return function() { | ||
return bc(ab.apply(this, arguments)); | ||
}; | ||
case 3: | ||
return function() { | ||
return cd(bc(ab.apply(this, arguments))); | ||
}; | ||
case 4: | ||
return function() { | ||
return de(cd(bc(ab.apply(this, arguments)))); | ||
}; | ||
case 5: | ||
return function() { | ||
return ef(de(cd(bc(ab.apply(this, arguments))))); | ||
}; | ||
case 6: | ||
return function() { | ||
return fg(ef(de(cd(bc(ab.apply(this, arguments)))))); | ||
}; | ||
case 7: | ||
return function() { | ||
return gh(fg(ef(de(cd(bc(ab.apply(this, arguments))))))); | ||
}; | ||
case 8: | ||
return function() { | ||
return hi(gh(fg(ef(de(cd(bc(ab.apply(this, arguments)))))))); | ||
}; | ||
case 9: | ||
return function() { | ||
return ij(hi(gh(fg(ef(de(cd(bc(ab.apply(this, arguments))))))))); | ||
}; | ||
} | ||
return; | ||
} | ||
var hole = /* @__PURE__ */ unsafeCoerce(absurd); | ||
var SK = (_2, b2) => b2; | ||
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Equivalence.js | ||
var make = (isEquivalent) => (self, that) => self === that || isEquivalent(self, that); | ||
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/internal/doNotation.js | ||
var let_ = (map2) => dual(3, (self, name2, f) => map2(self, (a) => Object.assign({}, a, { | ||
[name2]: f(a) | ||
}))); | ||
var bindTo = (map2) => dual(2, (self, name2) => map2(self, (a) => ({ | ||
[name2]: a | ||
}))); | ||
var bind = (map2, flatMap2) => dual(3, (self, name2, f) => flatMap2(self, (a) => map2(f(a), (b2) => Object.assign({}, a, { | ||
[name2]: b2 | ||
})))); | ||
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/internal/version.js | ||
var moduleVersion = "3.4.6"; | ||
var getCurrentVersion = () => moduleVersion; | ||
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/GlobalValue.js | ||
var globalStoreId = /* @__PURE__ */ Symbol.for(`effect/GlobalValue/globalStoreId/${/* @__PURE__ */ getCurrentVersion()}`); | ||
if (!(globalStoreId in globalThis)) { | ||
globalThis[globalStoreId] = /* @__PURE__ */ new Map(); | ||
} | ||
var globalStore = globalThis[globalStoreId]; | ||
var globalValue = (id, compute) => { | ||
if (!globalStore.has(id)) { | ||
globalStore.set(id, compute()); | ||
} | ||
return globalStore.get(id); | ||
}; | ||
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Predicate.js | ||
var Predicate_exports = {}; | ||
__export(Predicate_exports, { | ||
all: () => all, | ||
and: () => and, | ||
compose: () => compose2, | ||
eqv: () => eqv, | ||
every: () => every, | ||
hasProperty: () => hasProperty, | ||
implies: () => implies, | ||
isBigInt: () => isBigInt, | ||
isBoolean: () => isBoolean, | ||
isDate: () => isDate, | ||
isError: () => isError, | ||
isFunction: () => isFunction2, | ||
isIterable: () => isIterable, | ||
isMap: () => isMap, | ||
isNever: () => isNever, | ||
isNotNull: () => isNotNull, | ||
isNotNullable: () => isNotNullable, | ||
isNotUndefined: () => isNotUndefined, | ||
isNull: () => isNull, | ||
isNullable: () => isNullable, | ||
isNumber: () => isNumber, | ||
isObject: () => isObject, | ||
isPromise: () => isPromise, | ||
isPromiseLike: () => isPromiseLike, | ||
isReadonlyRecord: () => isReadonlyRecord, | ||
isRecord: () => isRecord, | ||
isSet: () => isSet, | ||
isString: () => isString, | ||
isSymbol: () => isSymbol, | ||
isTagged: () => isTagged, | ||
isTruthy: () => isTruthy, | ||
isTupleOf: () => isTupleOf, | ||
isTupleOfAtLeast: () => isTupleOfAtLeast, | ||
isUint8Array: () => isUint8Array, | ||
isUndefined: () => isUndefined, | ||
isUnknown: () => isUnknown, | ||
mapInput: () => mapInput, | ||
nand: () => nand, | ||
nor: () => nor, | ||
not: () => not, | ||
or: () => or, | ||
product: () => product, | ||
productMany: () => productMany, | ||
some: () => some, | ||
struct: () => struct, | ||
tuple: () => tuple, | ||
xor: () => xor | ||
}); | ||
var mapInput = /* @__PURE__ */ dual(2, (self, f) => (b2) => self(f(b2))); | ||
var isTupleOf = /* @__PURE__ */ dual(2, (self, n2) => self.length === n2); | ||
var isTupleOfAtLeast = /* @__PURE__ */ dual(2, (self, n2) => self.length >= n2); | ||
var isTruthy = (input) => !!input; | ||
var isSet = (input) => input instanceof Set; | ||
var isMap = (input) => input instanceof Map; | ||
var isString = (input) => typeof input === "string"; | ||
var isNumber = (input) => typeof input === "number"; | ||
var isBoolean = (input) => typeof input === "boolean"; | ||
var isBigInt = (input) => typeof input === "bigint"; | ||
var isSymbol = (input) => typeof input === "symbol"; | ||
var isFunction2 = isFunction; | ||
var isUndefined = (input) => input === void 0; | ||
var isNotUndefined = (input) => input !== void 0; | ||
var isNull = (input) => input === null; | ||
var isNotNull = (input) => input !== null; | ||
var isNever = (_2) => false; | ||
var isUnknown = (_2) => true; | ||
var isRecordOrArray = (input) => typeof input === "object" && input !== null; | ||
var isObject = (input) => isRecordOrArray(input) || isFunction2(input); | ||
var hasProperty = /* @__PURE__ */ dual(2, (self, property) => isObject(self) && property in self); | ||
var isTagged = /* @__PURE__ */ dual(2, (self, tag) => hasProperty(self, "_tag") && self["_tag"] === tag); | ||
var isNullable = (input) => input === null || input === void 0; | ||
var isNotNullable = (input) => input !== null && input !== void 0; | ||
var isError = (input) => input instanceof Error; | ||
var isUint8Array = (input) => input instanceof Uint8Array; | ||
var isDate = (input) => input instanceof Date; | ||
var isIterable = (input) => hasProperty(input, Symbol.iterator); | ||
var isRecord = (input) => isRecordOrArray(input) && !Array.isArray(input); | ||
var isReadonlyRecord = isRecord; | ||
var isPromise = (input) => hasProperty(input, "then") && "catch" in input && isFunction2(input.then) && isFunction2(input.catch); | ||
var isPromiseLike = (input) => hasProperty(input, "then") && isFunction2(input.then); | ||
var compose2 = /* @__PURE__ */ dual(2, (ab, bc) => (a) => ab(a) && bc(a)); | ||
var product = (self, that) => ([a, b2]) => self(a) && that(b2); | ||
var all = (collection) => { | ||
return (as2) => { | ||
let collectionIndex = 0; | ||
for (const p2 of collection) { | ||
if (collectionIndex >= as2.length) { | ||
break; | ||
} | ||
if (p2(as2[collectionIndex]) === false) { | ||
return false; | ||
} | ||
collectionIndex++; | ||
} | ||
return true; | ||
}; | ||
}; | ||
var productMany = (self, collection) => { | ||
const rest = all(collection); | ||
return ([head, ...tail]) => self(head) === false ? false : rest(tail); | ||
}; | ||
var tuple = (...elements) => all(elements); | ||
var struct = (fields) => { | ||
const keys = Object.keys(fields); | ||
return (a) => { | ||
for (const key of keys) { | ||
if (!fields[key](a[key])) { | ||
return false; | ||
} | ||
} | ||
return true; | ||
}; | ||
}; | ||
var not = (self) => (a) => !self(a); | ||
var or = /* @__PURE__ */ dual(2, (self, that) => (a) => self(a) || that(a)); | ||
var and = /* @__PURE__ */ dual(2, (self, that) => (a) => self(a) && that(a)); | ||
var xor = /* @__PURE__ */ dual(2, (self, that) => (a) => self(a) !== that(a)); | ||
var eqv = /* @__PURE__ */ dual(2, (self, that) => (a) => self(a) === that(a)); | ||
var implies = /* @__PURE__ */ dual(2, (antecedent, consequent) => (a) => antecedent(a) ? consequent(a) : true); | ||
var nor = /* @__PURE__ */ dual(2, (self, that) => (a) => !(self(a) || that(a))); | ||
var nand = /* @__PURE__ */ dual(2, (self, that) => (a) => !(self(a) && that(a))); | ||
var every = (collection) => (a) => { | ||
for (const p2 of collection) { | ||
if (!p2(a)) { | ||
return false; | ||
} | ||
} | ||
return true; | ||
}; | ||
var some = (collection) => (a) => { | ||
for (const p2 of collection) { | ||
if (p2(a)) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
}; | ||
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/internal/errors.js | ||
var getBugErrorMessage = (message) => `BUG: ${message} - please report an issue at https://github.com/Effect-TS/effect/issues`; | ||
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Utils.js | ||
var GenKindTypeId = /* @__PURE__ */ Symbol.for("effect/Gen/GenKind"); | ||
var isGenKind = (u2) => isObject(u2) && GenKindTypeId in u2; | ||
var GenKindImpl = class { | ||
value; | ||
constructor(value) { | ||
this.value = value; | ||
} | ||
/** | ||
* @since 2.0.0 | ||
*/ | ||
get _F() { | ||
return identity; | ||
} | ||
/** | ||
* @since 2.0.0 | ||
*/ | ||
get _R() { | ||
return (_2) => _2; | ||
} | ||
/** | ||
* @since 2.0.0 | ||
*/ | ||
get _O() { | ||
return (_2) => _2; | ||
} | ||
/** | ||
* @since 2.0.0 | ||
*/ | ||
get _E() { | ||
return (_2) => _2; | ||
} | ||
/** | ||
* @since 2.0.0 | ||
*/ | ||
[GenKindTypeId] = GenKindTypeId; | ||
/** | ||
* @since 2.0.0 | ||
*/ | ||
[Symbol.iterator]() { | ||
return new SingleShotGen(this); | ||
} | ||
}; | ||
var SingleShotGen = class _SingleShotGen { | ||
self; | ||
called = false; | ||
constructor(self) { | ||
this.self = self; | ||
} | ||
/** | ||
* @since 2.0.0 | ||
*/ | ||
next(a) { | ||
return this.called ? { | ||
value: a, | ||
done: true | ||
} : (this.called = true, { | ||
value: this.self, | ||
done: false | ||
}); | ||
} | ||
/** | ||
* @since 2.0.0 | ||
*/ | ||
return(a) { | ||
return { | ||
value: a, | ||
done: true | ||
}; | ||
} | ||
/** | ||
* @since 2.0.0 | ||
*/ | ||
throw(e2) { | ||
throw e2; | ||
} | ||
/** | ||
* @since 2.0.0 | ||
*/ | ||
[Symbol.iterator]() { | ||
return new _SingleShotGen(this.self); | ||
} | ||
}; | ||
var adapter = () => function() { | ||
let x2 = arguments[0]; | ||
for (let i2 = 1; i2 < arguments.length; i2++) { | ||
x2 = arguments[i2](x2); | ||
} | ||
return new GenKindImpl(x2); | ||
}; | ||
var YieldWrapTypeId = /* @__PURE__ */ Symbol.for("effect/Utils/YieldWrap"); | ||
var YieldWrap = class { | ||
/** | ||
* @since 3.0.6 | ||
*/ | ||
#value; | ||
constructor(value) { | ||
this.#value = value; | ||
} | ||
/** | ||
* @since 3.0.6 | ||
*/ | ||
[YieldWrapTypeId]() { | ||
return this.#value; | ||
} | ||
}; | ||
function yieldWrapGet(self) { | ||
if (typeof self === "object" && self !== null && YieldWrapTypeId in self) { | ||
return self[YieldWrapTypeId](); | ||
} | ||
throw new Error(getBugErrorMessage("yieldWrapGet")); | ||
} | ||
var structuralRegionState = /* @__PURE__ */ globalValue("effect/Utils/isStructuralRegion", () => ({ | ||
enabled: false, | ||
tester: void 0 | ||
})); | ||
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Hash.js | ||
var randomHashCache = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("effect/Hash/randomHashCache"), () => /* @__PURE__ */ new WeakMap()); | ||
var symbol = /* @__PURE__ */ Symbol.for("effect/Hash"); | ||
var hash = (self) => { | ||
if (structuralRegionState.enabled === true) { | ||
return 0; | ||
} | ||
switch (typeof self) { | ||
case "number": | ||
return number(self); | ||
case "bigint": | ||
return string(self.toString(10)); | ||
case "boolean": | ||
return string(String(self)); | ||
case "symbol": | ||
return string(String(self)); | ||
case "string": | ||
return string(self); | ||
case "undefined": | ||
return string("undefined"); | ||
case "function": | ||
case "object": { | ||
if (self === null) { | ||
return string("null"); | ||
} else if (self instanceof Date) { | ||
return hash(self.toISOString()); | ||
} else if (isHash(self)) { | ||
return self[symbol](); | ||
} else { | ||
return random(self); | ||
} | ||
} | ||
default: | ||
throw new Error(`BUG: unhandled typeof ${typeof self} - please report an issue at https://github.com/Effect-TS/effect/issues`); | ||
} | ||
}; | ||
var random = (self) => { | ||
if (!randomHashCache.has(self)) { | ||
randomHashCache.set(self, number(Math.floor(Math.random() * Number.MAX_SAFE_INTEGER))); | ||
} | ||
return randomHashCache.get(self); | ||
}; | ||
var combine = (b2) => (self) => self * 53 ^ b2; | ||
var optimize = (n2) => n2 & 3221225471 | n2 >>> 1 & 1073741824; | ||
var isHash = (u2) => hasProperty(u2, symbol); | ||
var number = (n2) => { | ||
if (n2 !== n2 || n2 === Infinity) { | ||
return 0; | ||
} | ||
let h = n2 | 0; | ||
if (h !== n2) { | ||
h ^= n2 * 4294967295; | ||
} | ||
while (n2 > 4294967295) { | ||
h ^= n2 /= 4294967295; | ||
} | ||
return optimize(n2); | ||
}; | ||
var string = (str) => { | ||
let h = 5381, i2 = str.length; | ||
while (i2) { | ||
h = h * 33 ^ str.charCodeAt(--i2); | ||
} | ||
return optimize(h); | ||
}; | ||
var cached = function() { | ||
if (arguments.length === 1) { | ||
const self2 = arguments[0]; | ||
return function(hash3) { | ||
Object.defineProperty(self2, symbol, { | ||
value() { | ||
return hash3; | ||
}, | ||
enumerable: false | ||
}); | ||
return hash3; | ||
}; | ||
} | ||
const self = arguments[0]; | ||
const hash2 = arguments[1]; | ||
Object.defineProperty(self, symbol, { | ||
value() { | ||
return hash2; | ||
}, | ||
enumerable: false | ||
}); | ||
return hash2; | ||
}; | ||
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Equal.js | ||
var symbol2 = /* @__PURE__ */ Symbol.for("effect/Equal"); | ||
function equals() { | ||
if (arguments.length === 1) { | ||
return (self) => compareBoth(self, arguments[0]); | ||
} | ||
return compareBoth(arguments[0], arguments[1]); | ||
} | ||
function compareBoth(self, that) { | ||
if (self === that) { | ||
return true; | ||
} | ||
const selfType = typeof self; | ||
if (selfType !== typeof that) { | ||
return false; | ||
} | ||
if (selfType === "object" || selfType === "function") { | ||
if (self !== null && that !== null) { | ||
if (isEqual(self) && isEqual(that)) { | ||
if (hash(self) === hash(that) && self[symbol2](that)) { | ||
return true; | ||
} else { | ||
return structuralRegionState.enabled && structuralRegionState.tester ? structuralRegionState.tester(self, that) : false; | ||
} | ||
} else if (self instanceof Date && that instanceof Date) { | ||
return self.toISOString() === that.toISOString(); | ||
} | ||
} | ||
if (structuralRegionState.enabled) { | ||
if (Array.isArray(self) && Array.isArray(that)) { | ||
return self.length === that.length && self.every((v2, i2) => compareBoth(v2, that[i2])); | ||
} | ||
if (Object.getPrototypeOf(self) === Object.prototype && Object.getPrototypeOf(self) === Object.prototype) { | ||
const keysSelf = Object.keys(self); | ||
const keysThat = Object.keys(that); | ||
if (keysSelf.length === keysThat.length) { | ||
for (const key of keysSelf) { | ||
if (!(key in that && compareBoth(self[key], that[key]))) { | ||
return structuralRegionState.tester ? structuralRegionState.tester(self, that) : false; | ||
} | ||
} | ||
return true; | ||
} | ||
} | ||
return structuralRegionState.tester ? structuralRegionState.tester(self, that) : false; | ||
} | ||
} | ||
return structuralRegionState.enabled && structuralRegionState.tester ? structuralRegionState.tester(self, that) : false; | ||
} | ||
var isEqual = (u2) => hasProperty(u2, symbol2); | ||
var equivalence = () => equals; | ||
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Inspectable.js | ||
var NodeInspectSymbol = /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom"); | ||
var toJSON = (x2) => { | ||
if (hasProperty(x2, "toJSON") && isFunction2(x2["toJSON"]) && x2["toJSON"].length === 0) { | ||
return x2.toJSON(); | ||
} else if (Array.isArray(x2)) { | ||
return x2.map(toJSON); | ||
} | ||
return x2; | ||
}; | ||
var format = (x2) => JSON.stringify(x2, null, 2); | ||
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Pipeable.js | ||
var pipeArguments = (self, args) => { | ||
switch (args.length) { | ||
case 1: | ||
return args[0](self); | ||
case 2: | ||
return args[1](args[0](self)); | ||
case 3: | ||
return args[2](args[1](args[0](self))); | ||
case 4: | ||
return args[3](args[2](args[1](args[0](self)))); | ||
case 5: | ||
return args[4](args[3](args[2](args[1](args[0](self))))); | ||
case 6: | ||
return args[5](args[4](args[3](args[2](args[1](args[0](self)))))); | ||
case 7: | ||
return args[6](args[5](args[4](args[3](args[2](args[1](args[0](self))))))); | ||
case 8: | ||
return args[7](args[6](args[5](args[4](args[3](args[2](args[1](args[0](self)))))))); | ||
case 9: | ||
return args[8](args[7](args[6](args[5](args[4](args[3](args[2](args[1](args[0](self))))))))); | ||
default: { | ||
let ret = self; | ||
for (let i2 = 0, len = args.length; i2 < len; i2++) { | ||
ret = args[i2](ret); | ||
} | ||
return ret; | ||
} | ||
} | ||
}; | ||
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/internal/effectable.js | ||
var EffectTypeId = /* @__PURE__ */ Symbol.for("effect/Effect"); | ||
var StreamTypeId = /* @__PURE__ */ Symbol.for("effect/Stream"); | ||
var SinkTypeId = /* @__PURE__ */ Symbol.for("effect/Sink"); | ||
var ChannelTypeId = /* @__PURE__ */ Symbol.for("effect/Channel"); | ||
var effectVariance = { | ||
/* c8 ignore next */ | ||
_R: (_2) => _2, | ||
/* c8 ignore next */ | ||
_E: (_2) => _2, | ||
/* c8 ignore next */ | ||
_A: (_2) => _2, | ||
_V: /* @__PURE__ */ getCurrentVersion() | ||
}; | ||
var sinkVariance = { | ||
/* c8 ignore next */ | ||
_A: (_2) => _2, | ||
/* c8 ignore next */ | ||
_In: (_2) => _2, | ||
/* c8 ignore next */ | ||
_L: (_2) => _2, | ||
/* c8 ignore next */ | ||
_E: (_2) => _2, | ||
/* c8 ignore next */ | ||
_R: (_2) => _2 | ||
}; | ||
var channelVariance = { | ||
/* c8 ignore next */ | ||
_Env: (_2) => _2, | ||
/* c8 ignore next */ | ||
_InErr: (_2) => _2, | ||
/* c8 ignore next */ | ||
_InElem: (_2) => _2, | ||
/* c8 ignore next */ | ||
_InDone: (_2) => _2, | ||
/* c8 ignore next */ | ||
_OutErr: (_2) => _2, | ||
/* c8 ignore next */ | ||
_OutElem: (_2) => _2, | ||
/* c8 ignore next */ | ||
_OutDone: (_2) => _2 | ||
}; | ||
var EffectPrototype = { | ||
[EffectTypeId]: effectVariance, | ||
[StreamTypeId]: effectVariance, | ||
[SinkTypeId]: sinkVariance, | ||
[ChannelTypeId]: channelVariance, | ||
[symbol2](that) { | ||
return this === that; | ||
}, | ||
[symbol]() { | ||
return cached(this, random(this)); | ||
}, | ||
[Symbol.iterator]() { | ||
return new SingleShotGen(new YieldWrap(this)); | ||
}, | ||
pipe() { | ||
return pipeArguments(this, arguments); | ||
} | ||
}; | ||
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/internal/option.js | ||
var TypeId = /* @__PURE__ */ Symbol.for("effect/Option"); | ||
var CommonProto = { | ||
...EffectPrototype, | ||
[TypeId]: { | ||
_A: (_2) => _2 | ||
}, | ||
[NodeInspectSymbol]() { | ||
return this.toJSON(); | ||
}, | ||
toString() { | ||
return format(this.toJSON()); | ||
} | ||
}; | ||
var SomeProto = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(CommonProto), { | ||
_tag: "Some", | ||
_op: "Some", | ||
[symbol2](that) { | ||
return isOption(that) && isSome(that) && equals(this.value, that.value); | ||
}, | ||
[symbol]() { | ||
return cached(this, combine(hash(this._tag))(hash(this.value))); | ||
}, | ||
toJSON() { | ||
return { | ||
_id: "Option", | ||
_tag: this._tag, | ||
value: toJSON(this.value) | ||
}; | ||
} | ||
}); | ||
var NoneHash = /* @__PURE__ */ hash("None"); | ||
var NoneProto = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(CommonProto), { | ||
_tag: "None", | ||
_op: "None", | ||
[symbol2](that) { | ||
return isOption(that) && isNone(that); | ||
}, | ||
[symbol]() { | ||
return NoneHash; | ||
}, | ||
toJSON() { | ||
return { | ||
_id: "Option", | ||
_tag: this._tag | ||
}; | ||
} | ||
}); | ||
var isOption = (input) => hasProperty(input, TypeId); | ||
var isNone = (fa) => fa._tag === "None"; | ||
var isSome = (fa) => fa._tag === "Some"; | ||
var none = /* @__PURE__ */ Object.create(NoneProto); | ||
var some2 = (value) => { | ||
const a = Object.create(SomeProto); | ||
a.value = value; | ||
return a; | ||
}; | ||
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/internal/either.js | ||
var TypeId2 = /* @__PURE__ */ Symbol.for("effect/Either"); | ||
var CommonProto2 = { | ||
...EffectPrototype, | ||
[TypeId2]: { | ||
_R: (_2) => _2 | ||
}, | ||
[NodeInspectSymbol]() { | ||
return this.toJSON(); | ||
}, | ||
toString() { | ||
return format(this.toJSON()); | ||
} | ||
}; | ||
var RightProto = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(CommonProto2), { | ||
_tag: "Right", | ||
_op: "Right", | ||
[symbol2](that) { | ||
return isEither(that) && isRight(that) && equals(this.right, that.right); | ||
}, | ||
[symbol]() { | ||
return combine(hash(this._tag))(hash(this.right)); | ||
}, | ||
toJSON() { | ||
return { | ||
_id: "Either", | ||
_tag: this._tag, | ||
right: toJSON(this.right) | ||
}; | ||
} | ||
}); | ||
var LeftProto = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(CommonProto2), { | ||
_tag: "Left", | ||
_op: "Left", | ||
[symbol2](that) { | ||
return isEither(that) && isLeft(that) && equals(this.left, that.left); | ||
}, | ||
[symbol]() { | ||
return combine(hash(this._tag))(hash(this.left)); | ||
}, | ||
toJSON() { | ||
return { | ||
_id: "Either", | ||
_tag: this._tag, | ||
left: toJSON(this.left) | ||
}; | ||
} | ||
}); | ||
var isEither = (input) => hasProperty(input, TypeId2); | ||
var isLeft = (ma) => ma._tag === "Left"; | ||
var isRight = (ma) => ma._tag === "Right"; | ||
var left = (left2) => { | ||
const a = Object.create(LeftProto); | ||
a.left = left2; | ||
return a; | ||
}; | ||
var right = (right2) => { | ||
const a = Object.create(RightProto); | ||
a.right = right2; | ||
return a; | ||
}; | ||
var getLeft = (self) => isRight(self) ? none : some2(self.left); | ||
var getRight = (self) => isLeft(self) ? none : some2(self.right); | ||
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Option.js | ||
var Option_exports = {}; | ||
__export(Option_exports, { | ||
Do: () => Do, | ||
TypeId: () => TypeId3, | ||
all: () => all2, | ||
andThen: () => andThen, | ||
ap: () => ap, | ||
as: () => as, | ||
asVoid: () => asVoid, | ||
bind: () => bind2, | ||
bindTo: () => bindTo2, | ||
composeK: () => composeK, | ||
contains: () => contains, | ||
containsWith: () => containsWith, | ||
exists: () => exists, | ||
filter: () => filter, | ||
filterMap: () => filterMap, | ||
firstSomeOf: () => firstSomeOf, | ||
flatMap: () => flatMap, | ||
flatMapNullable: () => flatMapNullable, | ||
flatten: () => flatten, | ||
fromIterable: () => fromIterable, | ||
fromNullable: () => fromNullable, | ||
gen: () => gen, | ||
getEquivalence: () => getEquivalence, | ||
getLeft: () => getLeft2, | ||
getOrElse: () => getOrElse, | ||
getOrNull: () => getOrNull, | ||
getOrThrow: () => getOrThrow, | ||
getOrThrowWith: () => getOrThrowWith, | ||
getOrUndefined: () => getOrUndefined, | ||
getOrder: () => getOrder, | ||
getRight: () => getRight2, | ||
isNone: () => isNone2, | ||
isOption: () => isOption2, | ||
isSome: () => isSome2, | ||
let: () => let_2, | ||
lift2: () => lift2, | ||
liftNullable: () => liftNullable, | ||
liftPredicate: () => liftPredicate, | ||
liftThrowable: () => liftThrowable, | ||
map: () => map, | ||
match: () => match, | ||
none: () => none2, | ||
orElse: () => orElse, | ||
orElseEither: () => orElseEither, | ||
orElseSome: () => orElseSome, | ||
partitionMap: () => partitionMap, | ||
product: () => product2, | ||
productMany: () => productMany2, | ||
reduceCompact: () => reduceCompact, | ||
some: () => some3, | ||
tap: () => tap, | ||
toArray: () => toArray, | ||
toRefinement: () => toRefinement, | ||
void: () => void_, | ||
zipLeft: () => zipLeft, | ||
zipRight: () => zipRight, | ||
zipWith: () => zipWith | ||
}); | ||
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Order.js | ||
var make2 = (compare) => (self, that) => self === that ? 0 : compare(self, that); | ||
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Option.js | ||
var TypeId3 = /* @__PURE__ */ Symbol.for("effect/Option"); | ||
var none2 = () => none; | ||
var some3 = some2; | ||
var isOption2 = isOption; | ||
var isNone2 = isNone; | ||
var isSome2 = isSome; | ||
var match = /* @__PURE__ */ dual(2, (self, { | ||
onNone, | ||
onSome | ||
}) => isNone2(self) ? onNone() : onSome(self.value)); | ||
var toRefinement = (f) => (a) => isSome2(f(a)); | ||
var fromIterable = (collection) => { | ||
for (const a of collection) { | ||
return some3(a); | ||
} | ||
return none2(); | ||
}; | ||
var getRight2 = getRight; | ||
var getLeft2 = getLeft; | ||
var getOrElse = /* @__PURE__ */ dual(2, (self, onNone) => isNone2(self) ? onNone() : self.value); | ||
var orElse = /* @__PURE__ */ dual(2, (self, that) => isNone2(self) ? that() : self); | ||
var orElseSome = /* @__PURE__ */ dual(2, (self, onNone) => isNone2(self) ? some3(onNone()) : self); | ||
var orElseEither = /* @__PURE__ */ dual(2, (self, that) => isNone2(self) ? map(that(), right) : map(self, left)); | ||
var firstSomeOf = (collection) => { | ||
let out = none2(); | ||
for (out of collection) { | ||
if (isSome2(out)) { | ||
return out; | ||
} | ||
} | ||
return out; | ||
}; | ||
var fromNullable = (nullableValue) => nullableValue == null ? none2() : some3(nullableValue); | ||
var liftNullable = (f) => (...a) => fromNullable(f(...a)); | ||
var getOrNull = /* @__PURE__ */ getOrElse(constNull); | ||
var getOrUndefined = /* @__PURE__ */ getOrElse(constUndefined); | ||
var liftThrowable = (f) => (...a) => { | ||
try { | ||
return some3(f(...a)); | ||
} catch (e2) { | ||
return none2(); | ||
} | ||
}; | ||
var getOrThrowWith = /* @__PURE__ */ dual(2, (self, onNone) => { | ||
if (isSome2(self)) { | ||
return self.value; | ||
} | ||
throw onNone(); | ||
}); | ||
var getOrThrow = /* @__PURE__ */ getOrThrowWith(() => new Error("getOrThrow called on a None")); | ||
var map = /* @__PURE__ */ dual(2, (self, f) => isNone2(self) ? none2() : some3(f(self.value))); | ||
var as = /* @__PURE__ */ dual(2, (self, b2) => map(self, () => b2)); | ||
var asVoid = /* @__PURE__ */ as(void 0); | ||
var void_ = /* @__PURE__ */ some3(void 0); | ||
var flatMap = /* @__PURE__ */ dual(2, (self, f) => isNone2(self) ? none2() : f(self.value)); | ||
var andThen = /* @__PURE__ */ dual(2, (self, f) => flatMap(self, (a) => { | ||
const b2 = isFunction(f) ? f(a) : f; | ||
return isOption2(b2) ? b2 : some3(b2); | ||
})); | ||
var flatMapNullable = /* @__PURE__ */ dual(2, (self, f) => isNone2(self) ? none2() : fromNullable(f(self.value))); | ||
var flatten = /* @__PURE__ */ flatMap(identity); | ||
var zipRight = /* @__PURE__ */ dual(2, (self, that) => flatMap(self, () => that)); | ||
var composeK = /* @__PURE__ */ dual(2, (afb, bfc) => (a) => flatMap(afb(a), bfc)); | ||
var zipLeft = /* @__PURE__ */ dual(2, (self, that) => tap(self, () => that)); | ||
var tap = /* @__PURE__ */ dual(2, (self, f) => flatMap(self, (a) => map(f(a), () => a))); | ||
var product2 = (self, that) => isSome2(self) && isSome2(that) ? some3([self.value, that.value]) : none2(); | ||
var productMany2 = (self, collection) => { | ||
if (isNone2(self)) { | ||
return none2(); | ||
} | ||
const out = [self.value]; | ||
for (const o2 of collection) { | ||
if (isNone2(o2)) { | ||
return none2(); | ||
} | ||
out.push(o2.value); | ||
} | ||
return some3(out); | ||
}; | ||
var all2 = (input) => { | ||
if (Symbol.iterator in input) { | ||
const out2 = []; | ||
for (const o2 of input) { | ||
if (isNone2(o2)) { | ||
return none2(); | ||
} | ||
out2.push(o2.value); | ||
} | ||
return some3(out2); | ||
} | ||
const out = {}; | ||
for (const key of Object.keys(input)) { | ||
const o2 = input[key]; | ||
if (isNone2(o2)) { | ||
return none2(); | ||
} | ||
out[key] = o2.value; | ||
} | ||
return some3(out); | ||
}; | ||
var zipWith = /* @__PURE__ */ dual(3, (self, that, f) => map(product2(self, that), ([a, b2]) => f(a, b2))); | ||
var ap = /* @__PURE__ */ dual(2, (self, that) => zipWith(self, that, (f, a) => f(a))); | ||
var reduceCompact = /* @__PURE__ */ dual(3, (self, b2, f) => { | ||
let out = b2; | ||
for (const oa of self) { | ||
if (isSome2(oa)) { | ||
out = f(out, oa.value); | ||
} | ||
} | ||
return out; | ||
}); | ||
var toArray = (self) => isNone2(self) ? [] : [self.value]; | ||
var partitionMap = /* @__PURE__ */ dual(2, (self, f) => { | ||
if (isNone2(self)) { | ||
return [none2(), none2()]; | ||
} | ||
const e2 = f(self.value); | ||
return isLeft(e2) ? [some3(e2.left), none2()] : [none2(), some3(e2.right)]; | ||
}); | ||
var filterMap = /* @__PURE__ */ dual(2, (self, f) => isNone2(self) ? none2() : f(self.value)); | ||
var filter = /* @__PURE__ */ dual(2, (self, predicate) => filterMap(self, (b2) => predicate(b2) ? some2(b2) : none)); | ||
var getEquivalence = (isEquivalent) => make((x2, y2) => isNone2(x2) ? isNone2(y2) : isNone2(y2) ? false : isEquivalent(x2.value, y2.value)); | ||
var getOrder = (O) => make2((self, that) => isSome2(self) ? isSome2(that) ? O(self.value, that.value) : 1 : -1); | ||
var lift2 = (f) => dual(2, (self, that) => zipWith(self, that, f)); | ||
var liftPredicate = /* @__PURE__ */ dual(2, (b2, predicate) => predicate(b2) ? some3(b2) : none2()); | ||
var containsWith = (isEquivalent) => dual(2, (self, a) => isNone2(self) ? false : isEquivalent(self.value, a)); | ||
var _equivalence = /* @__PURE__ */ equivalence(); | ||
var contains = /* @__PURE__ */ containsWith(_equivalence); | ||
var exists = /* @__PURE__ */ dual(2, (self, refinement) => isNone2(self) ? false : refinement(self.value)); | ||
var bindTo2 = /* @__PURE__ */ bindTo(map); | ||
var let_2 = /* @__PURE__ */ let_(map); | ||
var bind2 = /* @__PURE__ */ bind(map, flatMap); | ||
var Do = /* @__PURE__ */ some3({}); | ||
var adapter2 = /* @__PURE__ */ adapter(); | ||
var gen = (...args) => { | ||
let f; | ||
if (args.length === 1) { | ||
f = args[0]; | ||
} else { | ||
f = args[1].bind(args[0]); | ||
} | ||
const iterator = f(adapter2); | ||
let state = iterator.next(); | ||
if (state.done) { | ||
return some3(state.value); | ||
} else { | ||
let current = state.value; | ||
if (isGenKind(current)) { | ||
current = current.value; | ||
} else { | ||
current = yieldWrapGet(current); | ||
} | ||
if (isNone2(current)) { | ||
return current; | ||
} | ||
while (!state.done) { | ||
state = iterator.next(current.value); | ||
if (!state.done) { | ||
current = state.value; | ||
if (isGenKind(current)) { | ||
current = current.value; | ||
} else { | ||
current = yieldWrapGet(current); | ||
} | ||
if (isNone2(current)) { | ||
return current; | ||
} | ||
} | ||
} | ||
return some3(state.value); | ||
} | ||
}; | ||
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/MutableRef.js | ||
var MutableRef_exports = {}; | ||
__export(MutableRef_exports, { | ||
compareAndSet: () => compareAndSet, | ||
decrement: () => decrement, | ||
decrementAndGet: () => decrementAndGet, | ||
get: () => get, | ||
getAndDecrement: () => getAndDecrement, | ||
getAndIncrement: () => getAndIncrement, | ||
getAndSet: () => getAndSet, | ||
getAndUpdate: () => getAndUpdate, | ||
increment: () => increment, | ||
incrementAndGet: () => incrementAndGet, | ||
make: () => make3, | ||
set: () => set, | ||
setAndGet: () => setAndGet, | ||
toggle: () => toggle, | ||
update: () => update, | ||
updateAndGet: () => updateAndGet | ||
}); | ||
var TypeId4 = /* @__PURE__ */ Symbol.for("effect/MutableRef"); | ||
var MutableRefProto = { | ||
[TypeId4]: TypeId4, | ||
toString() { | ||
return format(this.toJSON()); | ||
}, | ||
toJSON() { | ||
return { | ||
_id: "MutableRef", | ||
current: toJSON(this.current) | ||
}; | ||
}, | ||
[NodeInspectSymbol]() { | ||
return this.toJSON(); | ||
}, | ||
pipe() { | ||
return pipeArguments(this, arguments); | ||
} | ||
}; | ||
var make3 = (value) => { | ||
const ref = Object.create(MutableRefProto); | ||
ref.current = value; | ||
return ref; | ||
}; | ||
var compareAndSet = /* @__PURE__ */ dual(3, (self, oldValue, newValue) => { | ||
if (equals(oldValue, self.current)) { | ||
self.current = newValue; | ||
return true; | ||
} | ||
return false; | ||
}); | ||
var decrement = (self) => update(self, (n2) => n2 - 1); | ||
var decrementAndGet = (self) => updateAndGet(self, (n2) => n2 - 1); | ||
var get = (self) => self.current; | ||
var getAndDecrement = (self) => getAndUpdate(self, (n2) => n2 - 1); | ||
var getAndIncrement = (self) => getAndUpdate(self, (n2) => n2 + 1); | ||
var getAndSet = /* @__PURE__ */ dual(2, (self, value) => { | ||
const ret = self.current; | ||
self.current = value; | ||
return ret; | ||
}); | ||
var getAndUpdate = /* @__PURE__ */ dual(2, (self, f) => getAndSet(self, f(get(self)))); | ||
var increment = (self) => update(self, (n2) => n2 + 1); | ||
var incrementAndGet = (self) => updateAndGet(self, (n2) => n2 + 1); | ||
var set = /* @__PURE__ */ dual(2, (self, value) => { | ||
self.current = value; | ||
return self; | ||
}); | ||
var setAndGet = /* @__PURE__ */ dual(2, (self, value) => { | ||
self.current = value; | ||
return self.current; | ||
}); | ||
var update = /* @__PURE__ */ dual(2, (self, f) => set(self, f(get(self)))); | ||
var updateAndGet = /* @__PURE__ */ dual(2, (self, f) => setAndGet(self, f(get(self)))); | ||
var toggle = (self) => update(self, (_2) => !_2); | ||
// ../../../node_modules/.pnpm/ts-pattern@5.2.0/node_modules/ts-pattern/dist/index.js | ||
var t = Symbol.for("@ts-pattern/matcher"); | ||
var e = Symbol.for("@ts-pattern/isVariadic"); | ||
var n = "@ts-pattern/anonymous-select-key"; | ||
var r = (t2) => Boolean(t2 && "object" == typeof t2); | ||
var i = (e2) => e2 && !!e2[t]; | ||
var o = (n2, s2, c2) => { | ||
if (i(n2)) { | ||
const e2 = n2[t](), { matched: r2, selections: i2 } = e2.match(s2); | ||
return r2 && i2 && Object.keys(i2).forEach((t2) => c2(t2, i2[t2])), r2; | ||
} | ||
if (r(n2)) { | ||
if (!r(s2)) return false; | ||
if (Array.isArray(n2)) { | ||
if (!Array.isArray(s2)) return false; | ||
let t2 = [], r2 = [], a = []; | ||
for (const o2 of n2.keys()) { | ||
const s3 = n2[o2]; | ||
i(s3) && s3[e] ? a.push(s3) : a.length ? r2.push(s3) : t2.push(s3); | ||
} | ||
if (a.length) { | ||
if (a.length > 1) throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed."); | ||
if (s2.length < t2.length + r2.length) return false; | ||
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); | ||
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)); | ||
} | ||
return n2.length === s2.length && n2.every((t3, e2) => o(t3, s2[e2], c2)); | ||
} | ||
return Object.keys(n2).every((e2) => { | ||
const r2 = n2[e2]; | ||
return (e2 in s2 || i(a = r2) && "optional" === a[t]().matcherType) && o(r2, s2[e2], c2); | ||
var a; | ||
}); | ||
} | ||
return Object.is(s2, n2); | ||
}; | ||
var s = (e2) => { | ||
var n2, o2, a; | ||
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) : []; | ||
}; | ||
var c = (t2, e2) => t2.reduce((t3, n2) => t3.concat(e2(n2)), []); | ||
function u(t2) { | ||
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) }); | ||
} | ||
function l(e2) { | ||
return u({ [t]: () => ({ match: (t2) => { | ||
let n2 = {}; | ||
const r2 = (t3, e3) => { | ||
n2[t3] = e3; | ||
}; | ||
return void 0 === t2 ? (s(e2).forEach((t3) => r2(t3, void 0)), { matched: true, selections: n2 }) : { matched: o(e2, t2, r2), selections: n2 }; | ||
}, getSelectionKeys: () => s(e2), matcherType: "optional" }) }); | ||
} | ||
function m(...e2) { | ||
return u({ [t]: () => ({ match: (t2) => { | ||
let n2 = {}; | ||
const r2 = (t3, e3) => { | ||
n2[t3] = e3; | ||
}; | ||
return { matched: e2.every((e3) => o(e3, t2, r2)), selections: n2 }; | ||
}, getSelectionKeys: () => c(e2, s), matcherType: "and" }) }); | ||
} | ||
function d(...e2) { | ||
return u({ [t]: () => ({ match: (t2) => { | ||
let n2 = {}; | ||
const r2 = (t3, e3) => { | ||
n2[t3] = e3; | ||
}; | ||
return c(e2, s).forEach((t3) => r2(t3, void 0)), { matched: e2.some((e3) => o(e3, t2, r2)), selections: n2 }; | ||
}, getSelectionKeys: () => c(e2, s), matcherType: "or" }) }); | ||
} | ||
function y(e2) { | ||
return { [t]: () => ({ match: (t2) => ({ matched: Boolean(e2(t2)) }) }) }; | ||
} | ||
function p(...e2) { | ||
const r2 = "string" == typeof e2[0] ? e2[0] : void 0, i2 = 2 === e2.length ? e2[1] : "string" == typeof e2[0] ? void 0 : e2[0]; | ||
return u({ [t]: () => ({ match: (t2) => { | ||
let e3 = { [null != r2 ? r2 : n]: t2 }; | ||
return { matched: void 0 === i2 || o(i2, t2, (t3, n2) => { | ||
e3[t3] = n2; | ||
}), selections: e3 }; | ||
}, getSelectionKeys: () => [null != r2 ? r2 : n].concat(void 0 === i2 ? [] : s(i2)) }) }); | ||
} | ||
function v(t2) { | ||
return "number" == typeof t2; | ||
} | ||
function b(t2) { | ||
return "string" == typeof t2; | ||
} | ||
function w(t2) { | ||
return "bigint" == typeof t2; | ||
} | ||
u(y(function(t2) { | ||
return true; | ||
})); | ||
var j = (t2) => Object.assign(u(t2), { startsWith: (e2) => { | ||
return j(m(t2, (n2 = e2, y((t3) => b(t3) && t3.startsWith(n2))))); | ||
var n2; | ||
}, endsWith: (e2) => { | ||
return j(m(t2, (n2 = e2, y((t3) => b(t3) && t3.endsWith(n2))))); | ||
var n2; | ||
}, 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) => { | ||
return j(m(t2, (n2 = e2, y((t3) => b(t3) && t3.includes(n2))))); | ||
var n2; | ||
}, regex: (e2) => { | ||
return j(m(t2, (n2 = e2, y((t3) => b(t3) && Boolean(t3.match(n2)))))); | ||
var n2; | ||
} }); | ||
j(y(b)); | ||
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))) }); | ||
K(y(v)); | ||
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))) }); | ||
A(y(w)); | ||
u(y(function(t2) { | ||
return "boolean" == typeof t2; | ||
})); | ||
u(y(function(t2) { | ||
return "symbol" == typeof t2; | ||
})); | ||
u(y(function(t2) { | ||
return null == t2; | ||
})); | ||
u(y(function(t2) { | ||
return null != t2; | ||
})); | ||
var W = { matched: false, value: void 0 }; | ||
function $(t2) { | ||
return new z(t2, W); | ||
} | ||
var z = class _z { | ||
constructor(t2, e2) { | ||
this.input = void 0, this.state = void 0, this.input = t2, this.state = e2; | ||
} | ||
with(...t2) { | ||
if (this.state.matched) return this; | ||
const e2 = t2[t2.length - 1], r2 = [t2[0]]; | ||
let i2; | ||
3 === t2.length && "function" == typeof t2[1] ? i2 = t2[1] : t2.length > 2 && r2.push(...t2.slice(1, t2.length - 1)); | ||
let s2 = false, c2 = {}; | ||
const a = (t3, e3) => { | ||
s2 = true, c2[t3] = e3; | ||
}, 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) }; | ||
return new _z(this.input, u2); | ||
} | ||
when(t2, e2) { | ||
if (this.state.matched) return this; | ||
const n2 = Boolean(t2(this.input)); | ||
return new _z(this.input, n2 ? { matched: true, value: e2(this.input, this.input) } : W); | ||
} | ||
otherwise(t2) { | ||
return this.state.matched ? this.state.value : t2(this.input); | ||
} | ||
exhaustive() { | ||
if (this.state.matched) return this.state.value; | ||
let t2; | ||
try { | ||
t2 = JSON.stringify(this.input); | ||
} catch (e2) { | ||
t2 = this.input; | ||
} | ||
throw new Error(`Pattern matching error: no pattern matches value ${t2}`); | ||
} | ||
run() { | ||
return this.exhaustive(); | ||
} | ||
returnType() { | ||
return this; | ||
} | ||
}; | ||
var createRule = shared.createRuleForPlugin("naming-convention"); | ||
@@ -70,4 +1387,4 @@ | ||
const options = context.options[0] ?? defaultOptions[0]; | ||
const excepts = effect.Predicate.isString(options) ? [] : options.excepts ?? []; | ||
const rule = effect.Predicate.isString(options) ? options : options.rule ?? "PascalCase"; | ||
const excepts = Predicate_exports.isString(options) ? [] : options.excepts ?? []; | ||
const rule = Predicate_exports.isString(options) ? options : options.rule ?? "PascalCase"; | ||
function validate(name2, casing = rule, ignores = excepts) { | ||
@@ -77,3 +1394,3 @@ if (ignores.map((pattern) => new RegExp(pattern, "u")).some((pattern) => pattern.test(name2))) { | ||
} | ||
return tsPattern.match(casing).with("CONSTANT_CASE", () => shared.RE_CONSTANT_CASE.test(name2)).with("PascalCase", () => shared.RE_PASCAL_CASE.test(name2)).exhaustive(); | ||
return $(casing).with("CONSTANT_CASE", () => shared.RE_CONSTANT_CASE.test(name2)).with("PascalCase", () => shared.RE_PASCAL_CASE.test(name2)).exhaustive(); | ||
} | ||
@@ -105,3 +1422,3 @@ const collector = core.useComponentCollector(context); | ||
const maybeId = ast.getFunctionIdentifier(component); | ||
if (effect.Option.isNone(maybeId)) continue; | ||
if (Option_exports.isNone(maybeId)) continue; | ||
const id = maybeId.value; | ||
@@ -120,3 +1437,3 @@ const { name: name2 } = id; | ||
const maybeId = ast.getClassIdentifier(component); | ||
if (effect.Option.isNone(maybeId)) continue; | ||
if (Option_exports.isNone(maybeId)) continue; | ||
const id = maybeId.value; | ||
@@ -138,2 +1455,304 @@ const { name: name2 } = id; | ||
}); | ||
// ../../../node_modules/.pnpm/pathe@1.1.2/node_modules/pathe/dist/shared/pathe.ff20891b.mjs | ||
var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//; | ||
function normalizeWindowsPath(input = "") { | ||
if (!input) { | ||
return input; | ||
} | ||
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r2) => r2.toUpperCase()); | ||
} | ||
var _UNC_REGEX = /^[/\\]{2}/; | ||
var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/; | ||
var _DRIVE_LETTER_RE = /^[A-Za-z]:$/; | ||
var _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/; | ||
var sep = "/"; | ||
var delimiter = ":"; | ||
var normalize = function(path2) { | ||
if (path2.length === 0) { | ||
return "."; | ||
} | ||
path2 = normalizeWindowsPath(path2); | ||
const isUNCPath = path2.match(_UNC_REGEX); | ||
const isPathAbsolute = isAbsolute(path2); | ||
const trailingSeparator = path2[path2.length - 1] === "/"; | ||
path2 = normalizeString(path2, !isPathAbsolute); | ||
if (path2.length === 0) { | ||
if (isPathAbsolute) { | ||
return "/"; | ||
} | ||
return trailingSeparator ? "./" : "."; | ||
} | ||
if (trailingSeparator) { | ||
path2 += "/"; | ||
} | ||
if (_DRIVE_LETTER_RE.test(path2)) { | ||
path2 += "/"; | ||
} | ||
if (isUNCPath) { | ||
if (!isPathAbsolute) { | ||
return `//./${path2}`; | ||
} | ||
return `//${path2}`; | ||
} | ||
return isPathAbsolute && !isAbsolute(path2) ? `/${path2}` : path2; | ||
}; | ||
var join = function(...arguments_) { | ||
if (arguments_.length === 0) { | ||
return "."; | ||
} | ||
let joined; | ||
for (const argument of arguments_) { | ||
if (argument && argument.length > 0) { | ||
if (joined === void 0) { | ||
joined = argument; | ||
} else { | ||
joined += `/${argument}`; | ||
} | ||
} | ||
} | ||
if (joined === void 0) { | ||
return "."; | ||
} | ||
return normalize(joined.replace(/\/\/+/g, "/")); | ||
}; | ||
function cwd() { | ||
if (typeof process !== "undefined" && typeof process.cwd === "function") { | ||
return process.cwd().replace(/\\/g, "/"); | ||
} | ||
return "/"; | ||
} | ||
var resolve = function(...arguments_) { | ||
arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument)); | ||
let resolvedPath = ""; | ||
let resolvedAbsolute = false; | ||
for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) { | ||
const path2 = index >= 0 ? arguments_[index] : cwd(); | ||
if (!path2 || path2.length === 0) { | ||
continue; | ||
} | ||
resolvedPath = `${path2}/${resolvedPath}`; | ||
resolvedAbsolute = isAbsolute(path2); | ||
} | ||
resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute); | ||
if (resolvedAbsolute && !isAbsolute(resolvedPath)) { | ||
return `/${resolvedPath}`; | ||
} | ||
return resolvedPath.length > 0 ? resolvedPath : "."; | ||
}; | ||
function normalizeString(path2, allowAboveRoot) { | ||
let res = ""; | ||
let lastSegmentLength = 0; | ||
let lastSlash = -1; | ||
let dots = 0; | ||
let char = null; | ||
for (let index = 0; index <= path2.length; ++index) { | ||
if (index < path2.length) { | ||
char = path2[index]; | ||
} else if (char === "/") { | ||
break; | ||
} else { | ||
char = "/"; | ||
} | ||
if (char === "/") { | ||
if (lastSlash === index - 1 || dots === 1) ; | ||
else if (dots === 2) { | ||
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") { | ||
if (res.length > 2) { | ||
const lastSlashIndex = res.lastIndexOf("/"); | ||
if (lastSlashIndex === -1) { | ||
res = ""; | ||
lastSegmentLength = 0; | ||
} else { | ||
res = res.slice(0, lastSlashIndex); | ||
lastSegmentLength = res.length - 1 - res.lastIndexOf("/"); | ||
} | ||
lastSlash = index; | ||
dots = 0; | ||
continue; | ||
} else if (res.length > 0) { | ||
res = ""; | ||
lastSegmentLength = 0; | ||
lastSlash = index; | ||
dots = 0; | ||
continue; | ||
} | ||
} | ||
if (allowAboveRoot) { | ||
res += res.length > 0 ? "/.." : ".."; | ||
lastSegmentLength = 2; | ||
} | ||
} else { | ||
if (res.length > 0) { | ||
res += `/${path2.slice(lastSlash + 1, index)}`; | ||
} else { | ||
res = path2.slice(lastSlash + 1, index); | ||
} | ||
lastSegmentLength = index - lastSlash - 1; | ||
} | ||
lastSlash = index; | ||
dots = 0; | ||
} else if (char === "." && dots !== -1) { | ||
++dots; | ||
} else { | ||
dots = -1; | ||
} | ||
} | ||
return res; | ||
} | ||
var isAbsolute = function(p2) { | ||
return _IS_ABSOLUTE_RE.test(p2); | ||
}; | ||
var toNamespacedPath = function(p2) { | ||
return normalizeWindowsPath(p2); | ||
}; | ||
var _EXTNAME_RE = /.(\.[^./]+)$/; | ||
var extname = function(p2) { | ||
const match2 = _EXTNAME_RE.exec(normalizeWindowsPath(p2)); | ||
return match2 && match2[1] || ""; | ||
}; | ||
var relative = function(from, to) { | ||
const _from = resolve(from).replace(_ROOT_FOLDER_RE, "$1").split("/"); | ||
const _to = resolve(to).replace(_ROOT_FOLDER_RE, "$1").split("/"); | ||
if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0]) { | ||
return _to.join("/"); | ||
} | ||
const _fromCopy = [..._from]; | ||
for (const segment of _fromCopy) { | ||
if (_to[0] !== segment) { | ||
break; | ||
} | ||
_from.shift(); | ||
_to.shift(); | ||
} | ||
return [..._from.map(() => ".."), ..._to].join("/"); | ||
}; | ||
var dirname = function(p2) { | ||
const segments = normalizeWindowsPath(p2).replace(/\/$/, "").split("/").slice(0, -1); | ||
if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) { | ||
segments[0] += "/"; | ||
} | ||
return segments.join("/") || (isAbsolute(p2) ? "/" : "."); | ||
}; | ||
var format2 = function(p2) { | ||
const segments = [p2.root, p2.dir, p2.base ?? p2.name + p2.ext].filter(Boolean); | ||
return normalizeWindowsPath( | ||
p2.root ? resolve(...segments) : segments.join("/") | ||
); | ||
}; | ||
var basename = function(p2, extension) { | ||
const lastSegment = normalizeWindowsPath(p2).split("/").pop(); | ||
return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment; | ||
}; | ||
var parse = function(p2) { | ||
const root = normalizeWindowsPath(p2).split("/").shift() || "/"; | ||
const base = basename(p2); | ||
const extension = extname(base); | ||
return { | ||
root, | ||
dir: dirname(p2), | ||
base, | ||
ext: extension, | ||
name: base.slice(0, base.length - extension.length) | ||
}; | ||
}; | ||
var path = { | ||
__proto__: null, | ||
basename, | ||
delimiter, | ||
dirname, | ||
extname, | ||
format: format2, | ||
isAbsolute, | ||
join, | ||
normalize, | ||
normalizeString, | ||
parse, | ||
relative, | ||
resolve, | ||
sep, | ||
toNamespacedPath | ||
}; | ||
// ../../../node_modules/.pnpm/string-ts@2.2.0/node_modules/string-ts/dist/index.mjs | ||
function charAt(str, index) { | ||
return str.charAt(index); | ||
} | ||
function join2(tuple2, delimiter2 = "") { | ||
return tuple2.join(delimiter2); | ||
} | ||
function replaceAll(sentence, lookup, replacement = "") { | ||
if (typeof sentence.replaceAll === "function") { | ||
return sentence.replaceAll(lookup, replacement); | ||
} | ||
const regex = new RegExp(lookup, "g"); | ||
return sentence.replace(regex, replacement); | ||
} | ||
function slice(str, start = 0, end = void 0) { | ||
return str.slice(start, end); | ||
} | ||
function toLowerCase(str) { | ||
return str.toLowerCase(); | ||
} | ||
function toUpperCase(str) { | ||
return str.toUpperCase(); | ||
} | ||
var UNESCAPED_SEPARATORS = [ | ||
"[", | ||
"]", | ||
"{", | ||
"}", | ||
"(", | ||
")", | ||
"|", | ||
"/", | ||
"-", | ||
"\\" | ||
]; | ||
var SEPARATORS = [...UNESCAPED_SEPARATORS, " ", "_", "."]; | ||
function escapeChar(char) { | ||
return UNESCAPED_SEPARATORS.includes(char) ? `\\${char}` : char; | ||
} | ||
var SEPARATOR_REGEX = new RegExp( | ||
`[${SEPARATORS.map(escapeChar).join("")}]`, | ||
"g" | ||
); | ||
function words(sentence) { | ||
return sentence.replace(SEPARATOR_REGEX, " ").replace(/([a-zA-Z])([0-9])/g, "$1 $2").replace(/([0-9])([a-zA-Z])/g, "$1 $2").replace(/([a-zA-Z0-9_\-./])([^a-zA-Z0-9_\-./'])/g, "$1 $2").replace(/([^a-zA-Z0-9_\-./'])([a-zA-Z0-9_\-./])/g, "$1 $2").replace(/([a-z])([A-Z])/g, "$1 $2").replace(/([A-Z])([A-Z][a-z])/g, "$1 $2").trim().split(/\s+/g); | ||
} | ||
function capitalize(str) { | ||
return join2([ | ||
toUpperCase(charAt(str, 0) ?? ""), | ||
slice(str, 1) | ||
]); | ||
} | ||
function pascalCaseAll(words2) { | ||
return words2.map((v2) => capitalize(toLowerCase(v2))); | ||
} | ||
function removeApostrophe(str) { | ||
return replaceAll(str, "'", ""); | ||
} | ||
function pascalCase(str) { | ||
return join2(pascalCaseAll(words(removeApostrophe(str)))); | ||
} | ||
function uncapitalize(str) { | ||
return join2([ | ||
toLowerCase(charAt(str, 0) ?? ""), | ||
slice(str, 1) | ||
]); | ||
} | ||
function camelCase(str) { | ||
return uncapitalize(pascalCase(removeApostrophe(str))); | ||
} | ||
function delimiterCase(str, delimiter2) { | ||
return join2(words(removeApostrophe(str)), delimiter2); | ||
} | ||
function kebabCase(str) { | ||
return toLowerCase(delimiterCase(removeApostrophe(str), "-")); | ||
} | ||
function snakeCase(str) { | ||
return toLowerCase(delimiterCase(removeApostrophe(str), "_")); | ||
} | ||
// src/rules/filename.ts | ||
var RULE_NAME2 = "filename"; | ||
@@ -193,5 +1812,5 @@ var defaultOptions2 = [ | ||
const options = context.options[0] ?? defaultOptions2[0]; | ||
const rule = effect.Predicate.isString(options) ? options : options.rule ?? "PascalCase"; | ||
const excepts = effect.Predicate.isString(options) ? [] : options.excepts ?? []; | ||
const extensions = effect.Predicate.isObject(options) && "extensions" in options ? options.extensions : defaultOptions2[0].extensions; | ||
const rule = Predicate_exports.isString(options) ? options : options.rule ?? "PascalCase"; | ||
const excepts = Predicate_exports.isString(options) ? [] : options.excepts ?? []; | ||
const extensions = Predicate_exports.isObject(options) && "extensions" in options ? options.extensions : defaultOptions2[0].extensions; | ||
const filename = context.filename; | ||
@@ -204,15 +1823,15 @@ const fileNameExt = filename.slice(filename.lastIndexOf(".")); | ||
} | ||
return tsPattern.match(casing).with("PascalCase", () => shared.RE_PASCAL_CASE.test(name2)).with("camelCase", () => shared.RE_CAMEL_CASE.test(name2)).with("kebab-case", () => shared.RE_KEBAB_CASE.test(name2)).with("snake_case", () => shared.RE_SNAKE_CASE.test(name2)).exhaustive(); | ||
return $(casing).with("PascalCase", () => shared.RE_PASCAL_CASE.test(name2)).with("camelCase", () => shared.RE_CAMEL_CASE.test(name2)).with("kebab-case", () => shared.RE_KEBAB_CASE.test(name2)).with("snake_case", () => shared.RE_SNAKE_CASE.test(name2)).exhaustive(); | ||
} | ||
function getSuggestion(name2, casing = rule) { | ||
return tsPattern.match(casing).with("PascalCase", () => stringTs.pascalCase(name2)).with("camelCase", () => stringTs.camelCase(name2)).with("kebab-case", () => stringTs.kebabCase(name2)).with("snake_case", () => stringTs.snakeCase(name2)).exhaustive(); | ||
return $(casing).with("PascalCase", () => pascalCase(name2)).with("camelCase", () => camelCase(name2)).with("kebab-case", () => kebabCase(name2)).with("snake_case", () => snakeCase(name2)).exhaustive(); | ||
} | ||
return { | ||
Program(node) { | ||
const [basename = "", ...rest] = path__default.default.basename(context.filename).split("."); | ||
if (basename.length === 0) { | ||
const [basename2 = "", ...rest] = path.basename(context.filename).split("."); | ||
if (basename2.length === 0) { | ||
context.report({ messageId: "FILENAME_EMPTY", node }); | ||
return; | ||
} | ||
if (validate(basename)) return; | ||
if (validate(basename2)) return; | ||
context.report({ | ||
@@ -222,3 +1841,3 @@ data: { | ||
rule, | ||
suggestion: [getSuggestion(basename), ...rest].join(".") | ||
suggestion: [getSuggestion(basename2), ...rest].join(".") | ||
}, | ||
@@ -233,2 +1852,4 @@ messageId: "FILENAME_CASE_MISMATCH_SUGGESTION", | ||
}); | ||
// src/rules/filename-extension.ts | ||
var RULE_NAME3 = "filename-extension"; | ||
@@ -282,12 +1903,12 @@ var defaultOptions3 = [{ | ||
const options = context.options[0] ?? defaultOptions3[0]; | ||
const allow = effect.Predicate.isObject(options) ? options.allow : options; | ||
const extensions = effect.Predicate.isObject(options) && "extensions" in options ? options.extensions : defaultOptions3[0].extensions; | ||
const allow = Predicate_exports.isObject(options) ? options.allow : options; | ||
const extensions = Predicate_exports.isObject(options) && "extensions" in options ? options.extensions : defaultOptions3[0].extensions; | ||
const filename = context.getFilename(); | ||
const hasJSXNodeRef = effect.MutableRef.make(false); | ||
const hasJSXNodeRef = MutableRef_exports.make(false); | ||
return { | ||
JSXElement() { | ||
effect.MutableRef.set(hasJSXNodeRef, true); | ||
MutableRef_exports.set(hasJSXNodeRef, true); | ||
}, | ||
JSXFragment() { | ||
effect.MutableRef.set(hasJSXNodeRef, true); | ||
MutableRef_exports.set(hasJSXNodeRef, true); | ||
}, | ||
@@ -297,3 +1918,3 @@ "Program:exit"(node) { | ||
const isJSXExt = extensions.includes(fileNameExt); | ||
const hasJSXCode = effect.MutableRef.get(hasJSXNodeRef); | ||
const hasJSXCode = MutableRef_exports.get(hasJSXNodeRef); | ||
if (hasJSXCode && !isJSXExt) { | ||
@@ -346,3 +1967,3 @@ context.report({ | ||
for (const hookCall of hookCalls) { | ||
if (!core.isUseStateCall(hookCall, context) && !alias.some(effect.Function.flip(core.isReactHookCallWithNameLoose)(hookCall))) { | ||
if (!core.isUseStateCall(hookCall, context) && !alias.some(Function_exports.flip(core.isReactHookCallWithNameLoose)(hookCall))) { | ||
continue; | ||
@@ -354,19 +1975,19 @@ } | ||
const { id } = hookCall.parent; | ||
const descriptor = effect.Option.some({ messageId: "USE_STATE", node: id }); | ||
effect.Function.pipe( | ||
tsPattern.match(id).with({ type: ast.NodeType.Identifier }, effect.Function.constant(descriptor)).with({ type: ast.NodeType.ArrayPattern }, (n) => { | ||
const [state, setState] = n.elements; | ||
const descriptor = Option_exports.some({ messageId: "USE_STATE", node: id }); | ||
Function_exports.pipe( | ||
$(id).with({ type: ast.NodeType.Identifier }, Function_exports.constant(descriptor)).with({ type: ast.NodeType.ArrayPattern }, (n2) => { | ||
const [state, setState] = n2.elements; | ||
if (state?.type === ast.NodeType.ObjectPattern && setState?.type === ast.NodeType.Identifier) { | ||
return effect.Function.pipe( | ||
effect.Option.liftPredicate(effect.Predicate.not(isSetterNameLoose))(setState.name), | ||
effect.Option.flatMap(effect.Function.constant(descriptor)) | ||
return Function_exports.pipe( | ||
Option_exports.liftPredicate(Predicate_exports.not(isSetterNameLoose))(setState.name), | ||
Option_exports.flatMap(Function_exports.constant(descriptor)) | ||
); | ||
} | ||
if (state?.type !== ast.NodeType.Identifier || setState?.type !== ast.NodeType.Identifier) return effect.Option.none(); | ||
if (state?.type !== ast.NodeType.Identifier || setState?.type !== ast.NodeType.Identifier) return Option_exports.none(); | ||
const [stateName, setStateName] = [state.name, setState.name]; | ||
const expectedSetterName = `set${stringTs.capitalize(stateName)}`; | ||
if (setStateName === expectedSetterName) return effect.Option.none(); | ||
const expectedSetterName = `set${capitalize(stateName)}`; | ||
if (setStateName === expectedSetterName) return Option_exports.none(); | ||
return descriptor; | ||
}).otherwise(effect.Option.none), | ||
effect.Option.map(context.report) | ||
}).otherwise(Option_exports.none), | ||
Option_exports.map(context.report) | ||
); | ||
@@ -373,0 +1994,0 @@ } |
{ | ||
"name": "eslint-plugin-react-naming-convention", | ||
"version": "1.5.21-next.0", | ||
"version": "1.5.21-next.1", | ||
"description": "ESLint React's ESLint plugin for naming convention related rules.", | ||
@@ -42,8 +42,8 @@ "homepage": "https://github.com/rel1cx/eslint-react", | ||
"@typescript-eslint/utils": "^7.15.0", | ||
"@eslint-react/ast": "1.5.21-next.0", | ||
"@eslint-react/shared": "1.5.21-next.0", | ||
"@eslint-react/core": "1.5.21-next.0", | ||
"@eslint-react/tools": "1.5.21-next.0", | ||
"@eslint-react/jsx": "1.5.21-next.0", | ||
"@eslint-react/types": "1.5.21-next.0" | ||
"@eslint-react/ast": "1.5.21-next.1", | ||
"@eslint-react/jsx": "1.5.21-next.1", | ||
"@eslint-react/core": "1.5.21-next.1", | ||
"@eslint-react/shared": "1.5.21-next.1", | ||
"@eslint-react/tools": "1.5.21-next.1", | ||
"@eslint-react/types": "1.5.21-next.1" | ||
}, | ||
@@ -50,0 +50,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
131301
321.31%3972
417.86%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed