From e4f7fcab80a5bba15273d6188dde04fb1bf0ec30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eray=20Hano=C4=9Flu?= Date: Wed, 24 Apr 2024 23:35:00 +0300 Subject: [PATCH] Added js level utilities Configured prettier --- .prettierignore | 27 +- .prettierrc | 7 +- jest.config.js | 16 - jest.config.mjs | 18 + jest.nostrict.config.js | 16 - jest.nostrict.config.mjs | 17 + lib/combine.d.ts | 8 +- lib/dto.d.ts | 18 +- lib/helpers.d.ts | 41 +- lib/index.cjs | 16 + lib/index.d.ts | 76 +- lib/index.js | 0 lib/index.mjs | 16 + lib/logical.d.ts | 40 +- lib/mutable.d.ts | 41 +- lib/nullish.d.ts | 33 +- lib/omit-never.d.ts | 30 +- lib/omit.d.ts | 50 +- lib/opaque.ts | 2 +- lib/partial.d.ts | 36 +- lib/pick.d.ts | 91 +- lib/readonly.d.ts | 170 ++-- lib/required.d.ts | 172 ++-- lib/type-check.d.ts | 180 ++-- lib/types.d.ts | 57 +- package-lock.json | 1691 +++++++++++++++++++++++++++++++++++--- package.json | 19 +- test/_support/asserts.ts | 2 +- test/combine.spec.ts | 47 +- test/helpers.spec.ts | 11 +- test/logical.spec.ts | 2 - test/mutable.spec.ts | 87 +- test/nullish.spec.ts | 135 +-- test/omit-never.spec.ts | 166 ++-- test/omit.spec.ts | 129 +-- test/partial.spec.ts | 111 +-- test/pick.spec.ts | 130 +-- test/readonly.spec.ts | 251 +++--- test/required.spec.ts | 324 ++++---- test/type-check.spec.ts | 748 +++++++++-------- tsconfig.json | 9 +- 41 files changed, 3442 insertions(+), 1598 deletions(-) delete mode 100644 jest.config.js create mode 100644 jest.config.mjs delete mode 100644 jest.nostrict.config.js create mode 100644 jest.nostrict.config.mjs create mode 100644 lib/index.cjs delete mode 100644 lib/index.js create mode 100644 lib/index.mjs diff --git a/.prettierignore b/.prettierignore index d4f0bb0..1c01163 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,3 +1,24 @@ -node_modules -.vscode -package.json +/node_modules +/coverage +/.idea +/.circleci +/.husky +/.DS_Store +/.nyc_output +/.github +/*.md + +# IDEs and editors +.project +.classpath +.c9/ +*.launch +.settings/ +*.sublime-workspace + +# IDE - VSCode +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json diff --git a/.prettierrc b/.prettierrc index 697fef0..7cac555 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,8 +1,5 @@ { - "printWidth": 120, - "tabWidth": 2, - "semi": true, "singleQuote": true, - "trailingComma": "all", - "proseWrap": "always" + "arrowParens": "avoid", + "trailingComma": "all" } diff --git a/jest.config.js b/jest.config.js deleted file mode 100644 index e3faff1..0000000 --- a/jest.config.js +++ /dev/null @@ -1,16 +0,0 @@ -module.exports = { - testEnvironment: 'node', - verbose: true, - maxWorkers: "50%", - "testMatch": [ - "/test/**/*.spec.ts" - ], - transform: { - '^.+.ts?$': ['ts-jest', { - tsconfig: '/tsconfig.json' - }] - }, - moduleNameMapper: { - '(\\..+)\\.js': '$1' - } -}; diff --git a/jest.config.mjs b/jest.config.mjs new file mode 100644 index 0000000..61ff36d --- /dev/null +++ b/jest.config.mjs @@ -0,0 +1,18 @@ +export default { + testEnvironment: 'node', + verbose: true, + maxWorkers: '50%', + testMatch: ['/test/**/*.spec.ts'], + transform: { + '^.+\\.m?[tj]sx?$': [ + 'ts-jest', + { + tsconfig: '/tsconfig.json', + }, + ], + }, + transformIgnorePatterns: ['node_modules'], + moduleNameMapper: { + '^(\\.{1,2}/.*)\\.js$': '$1', + }, +}; diff --git a/jest.nostrict.config.js b/jest.nostrict.config.js deleted file mode 100644 index 7a7acfa..0000000 --- a/jest.nostrict.config.js +++ /dev/null @@ -1,16 +0,0 @@ -module.exports = { - testEnvironment: 'node', - verbose: true, - maxWorkers: "50%", - "testMatch": [ - "/test/**/*.spec.ts" - ], - transform: { - '^.+.ts?$': ['ts-jest', { - tsconfig: '/tsconfig-nostrict.json' - }] - }, - moduleNameMapper: { - '(\\..+)\\.js': '$1' - } -}; diff --git a/jest.nostrict.config.mjs b/jest.nostrict.config.mjs new file mode 100644 index 0000000..c060b7e --- /dev/null +++ b/jest.nostrict.config.mjs @@ -0,0 +1,17 @@ +export default { + testEnvironment: 'node', + verbose: true, + maxWorkers: '50%', + testMatch: ['/test/**/*.spec.ts'], + transform: { + '^.+.ts?$': [ + 'ts-jest', + { + tsconfig: '/tsconfig-nostrict.json', + }, + ], + }, + moduleNameMapper: { + '(\\..+)\\.js': '$1', + }, +}; diff --git a/lib/combine.d.ts b/lib/combine.d.ts index d8fc8fa..d9513f7 100644 --- a/lib/combine.d.ts +++ b/lib/combine.d.ts @@ -1,7 +1,7 @@ /** * Merges types without merging types of properties. */ -export type Combine = T1 - & Omit - & Omit - & Omit; +export type Combine = T1 & + Omit & + Omit & + Omit; diff --git a/lib/dto.d.ts b/lib/dto.d.ts index 7f13bfe..de30d53 100644 --- a/lib/dto.d.ts +++ b/lib/dto.d.ts @@ -8,13 +8,17 @@ import { IfNever } from './type-check.js'; * @template T - The type of the data being transferred. */ export type DTO = { - [K in keyof T as (IfNever, never, K>)]: - // Deep process arrays - Exclude extends (infer U)[] ? DTO[] - // Do not deep process No-Deep values - : IfNoDeepValue> extends true ? Exclude - // Deep process objects - : DTO> + [K in keyof T as IfNever< + Exclude, + never, + K + >]: Exclude extends (infer U)[] // Deep process arrays + ? DTO[] + : // Do not deep process No-Deep values + IfNoDeepValue> extends true + ? Exclude + : // Deep process objects + DTO>; }; export type PartialDTO = DeepPartial>; diff --git a/lib/helpers.d.ts b/lib/helpers.d.ts index e32f2ab..8e4a6c9 100644 --- a/lib/helpers.d.ts +++ b/lib/helpers.d.ts @@ -4,25 +4,34 @@ import { Builtin } from './types'; /** * Returns true if T is excluded from deep operations */ -export type IfNoDeepValue = - T extends Builtin ? true - : IfAny extends true ? T - : IfTuple extends true ? true - : T extends Function ? true - : IfClass extends true ? true - : T extends Map ? true - : T extends ReadonlyMap ? true - : T extends WeakMap ? true - : T extends Set ? true - : T extends ReadonlySet ? true - : T extends WeakSet ? true - : T extends any[] ? true - : false; - +export type IfNoDeepValue = T extends Builtin + ? true + : IfAny extends true + ? T + : IfTuple extends true + ? true + : T extends Function + ? true + : IfClass extends true + ? true + : T extends Map + ? true + : T extends ReadonlyMap + ? true + : T extends WeakMap + ? true + : T extends Set + ? true + : T extends ReadonlySet + ? true + : T extends WeakSet + ? true + : T extends any[] + ? true + : false; /** * ValuesOf * @desc Returns the union type of all the values in a type */ export type ValuesOf = T[keyof T]; - diff --git a/lib/index.cjs b/lib/index.cjs new file mode 100644 index 0000000..8d2e90d --- /dev/null +++ b/lib/index.cjs @@ -0,0 +1,16 @@ +const noOp = x => x; + +module.exports = { + asMutable: noOp, + asDeepMutable: noOp, + asDeeperMutable: noOp, + asReadonly: noOp, + asDeepReadonly: noOp, + asDeeperReadonly: noOp, + asPartial: noOp, + asDeepPartial: noOp, + asDeeperPartial: noOp, + asRequired: noOp, + asDeepRequired: noOp, + asDeeperRequired: noOp, +}; diff --git a/lib/index.d.ts b/lib/index.d.ts index 96102fc..8bdf4aa 100644 --- a/lib/index.d.ts +++ b/lib/index.d.ts @@ -1,15 +1,61 @@ -export * from "./combine"; -export * from "./dto"; -export * from "./helpers"; -export * from "./logical.js"; -export * from "./mutable"; -export * from "./nullish"; -export * from "./omit"; -export * from "./omit-never"; -export * from "./opaque"; -export * from "./partial"; -export * from "./pick"; -export * from "./readonly"; -export * from "./required"; -export * from "./type-check"; -export * from "./types"; +// noinspection JSUnusedGlobalSymbols + +import { DeeperMutable, DeepMutable, Mutable } from './mutable'; +import { DeeperPartial, DeepPartial } from './partial'; +import { DeeperReadonly, DeepReadonly } from './readonly'; +import { DeeperRequired, DeepRequired } from './required'; + +export * from './combine'; +export * from './dto'; +export * from './helpers'; +export * from './logical'; +export * from './mutable'; +export * from './nullish'; +export * from './omit'; +export * from './omit-never'; +export * from './opaque'; +export * from './partial'; +export * from './pick'; +export * from './readonly'; +export * from './required'; +export * from './type-check'; +export * from './types'; + +declare function asMutable(x: T): Mutable; + +declare function asDeepMutable(x: T): DeepMutable; + +declare function asDeeperMutable(x: T): DeeperMutable; + +declare function asReadonly(x: T): Readonly; + +declare function asDeepReadonly(x: T): DeepReadonly; + +declare function asDeeperReadonly(x: T): DeeperReadonly; + +declare function asPartial(x: T): Partial; + +declare function asDeepPartial(x: T): DeepPartial; + +declare function asDeeperPartial(x: T): DeeperPartial; + +declare function asRequired(x: T): Required; + +declare function asDeepRequired(x: T): DeepRequired; + +declare function asDeeperRequired(x: T): DeeperRequired; + +export { + asMutable, + asDeepMutable, + asDeeperMutable, + asReadonly, + asDeepReadonly, + asDeeperReadonly, + asPartial, + asDeepPartial, + asDeeperPartial, + asRequired, + asDeepRequired, + asDeeperRequired, +}; diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index e69de29..0000000 diff --git a/lib/index.mjs b/lib/index.mjs new file mode 100644 index 0000000..da70035 --- /dev/null +++ b/lib/index.mjs @@ -0,0 +1,16 @@ +const noOp = x => x; + +export { + noOp as asMutable, + noOp as asDeepMutable, + noOp as asDeeperMutable, + noOp as asReadonly, + noOp as asDeepReadonly, + noOp as asDeeperReadonly, + noOp as asPartial, + noOp as asDeepPartial, + noOp as asDeeperPartial, + noOp as asRequired, + noOp as asDeepRequired, + noOp as asDeeperRequired, +}; diff --git a/lib/logical.d.ts b/lib/logical.d.ts index b541a5c..f6bff66 100644 --- a/lib/logical.d.ts +++ b/lib/logical.d.ts @@ -1,19 +1,31 @@ import { IfNever } from './type-check'; export type And = - IfNever> extends true ? false : - IfNever> extends true ? false : - IfNever> extends true ? false : - IfNever> extends true ? false : - IfNever> extends true ? false : - IfNever> extends true ? false : - true; + IfNever> extends true + ? false + : IfNever> extends true + ? false + : IfNever> extends true + ? false + : IfNever> extends true + ? false + : IfNever> extends true + ? false + : IfNever> extends true + ? false + : true; export type Or = - IfNever> extends false ? true : - IfNever> extends false ? true : - IfNever> extends false ? true : - IfNever> extends false ? true : - IfNever> extends false ? true : - IfNever> extends false ? true : - false; + IfNever> extends false + ? true + : IfNever> extends false + ? true + : IfNever> extends false + ? true + : IfNever> extends false + ? true + : IfNever> extends false + ? true + : IfNever> extends false + ? true + : false; diff --git a/lib/mutable.d.ts b/lib/mutable.d.ts index 6439091..aa2a62f 100644 --- a/lib/mutable.d.ts +++ b/lib/mutable.d.ts @@ -5,7 +5,7 @@ import { DeepOmitReadonly, DeepPickReadonly, OmitReadonly, - PickReadonly + PickReadonly, } from './readonly'; import { IfNever } from './type-check'; @@ -13,38 +13,44 @@ import { IfNever } from './type-check'; * Make all properties in T mutable */ export type Mutable = { - -readonly [K in keyof T as (IfNever, never, K>)]: T[K]; + -readonly [K in keyof T as IfNever, never, K>]: T[K]; }; - /** * Marks given keys as mutable */ -export type MutableSome = Mutable> & Omit; - +export type MutableSome = Mutable> & + Omit; /** * Make all properties in T mutable deeply */ export type DeepMutable = { - -readonly [K in keyof T as (IfNever, never, K>)]: - // Do not deep process No-Deep values - IfNoDeepValue> extends true ? T[K] - // Deep process objects - : DeepMutable> + -readonly [K in keyof T as IfNever< + Exclude, + never, + K + >]: IfNoDeepValue> extends true // Do not deep process No-Deep values + ? T[K] + : // Deep process objects + DeepMutable>; }; /** * Make all properties in T mutable deeply */ export type DeeperMutable = { - -readonly [K in keyof T as (IfNever, never, K>)]: - // Deep process arrays - Exclude extends (infer U)[] ? DeeperMutable[] - // Do not deep process No-Deep values - : IfNoDeepValue> extends true ? T[K] - // Deep process objects - : DeeperMutable> + -readonly [K in keyof T as IfNever< + Exclude, + never, + K + >]: Exclude extends (infer U)[] // Deep process arrays + ? DeeperMutable[] + : // Do not deep process No-Deep values + IfNoDeepValue> extends true + ? T[K] + : // Deep process objects + DeeperMutable>; }; /** @@ -81,4 +87,3 @@ export type DeeperPickMutable = DeeperOmitReadonly; * Pick all mutable properties in T deeply including arrays */ export type DeeperOmitMutable = DeeperPickReadonly; - diff --git a/lib/nullish.d.ts b/lib/nullish.d.ts index c58552a..0d03140 100644 --- a/lib/nullish.d.ts +++ b/lib/nullish.d.ts @@ -4,31 +4,34 @@ import { IfNever } from './type-check'; /** * Make all properties in T nullish */ -export type NullishObject ={ - [K in keyof T as (IfNever, never, K>)]?: T[K] | null +export type NullishObject = { + [K in keyof T as IfNever, never, K>]?: T[K] | null; }; - /** * Make all properties in T nullish deeply */ export type DeepNullish = { - [K in keyof T as (IfNever, never, K>)]?: - // Do not deep process No-Deep values - IfNoDeepValue> extends true ? (T[K] | null) - // Deep process objects - : DeepNullish> | null + [K in keyof T as IfNever, never, K>]?: IfNoDeepValue< // Do not deep process No-Deep values + Exclude + > extends true + ? T[K] | null + : // Deep process objects + DeepNullish> | null; }; /** * Make all properties in T nullish deeply including arrays */ export type DeeperNullish = { - [K in keyof T as (IfNever, never, K>)]?: - // Deep process arrays - Exclude extends (infer U)[] ? DeeperNullish[] | null - // Do not deep process No-Deep values - : IfNoDeepValue> extends true ? (T[K] | null) - // Deep process objects - : DeeperNullish> | null + [K in keyof T as IfNever, never, K>]?: Exclude< // Deep process arrays + T[K], + undefined + > extends (infer U)[] + ? DeeperNullish[] | null + : // Do not deep process No-Deep values + IfNoDeepValue> extends true + ? T[K] | null + : // Deep process objects + DeeperNullish> | null; }; diff --git a/lib/omit-never.d.ts b/lib/omit-never.d.ts index ecb8fc9..7c1e09a 100644 --- a/lib/omit-never.d.ts +++ b/lib/omit-never.d.ts @@ -21,29 +21,33 @@ import { IfNever } from './type-check'; * // } */ export type OmitNever = { - [K in keyof T as (IfNever, never, K>)]: T[K] + [K in keyof T as IfNever, never, K>]: T[K]; }; /** * Omit all "never" and "undefined" properties in T deeply */ export type DeepOmitNever = { - [K in keyof T as (IfNever, never, K>)]: - // Do not deep process No-Deep values - IfNoDeepValue> extends true ? T[K] - // Deep process objects - : DeepOmitNever> + [K in keyof T as IfNever, never, K>]: IfNoDeepValue< // Do not deep process No-Deep values + Exclude + > extends true + ? T[K] + : // Deep process objects + DeepOmitNever>; }; /** * Omit all "never" and "undefined" properties in T deeply including arrays */ export type DeeperOmitNever = { - [K in keyof T as (IfNever, never, K>)]: - // Deep process arrays - Exclude extends (infer U)[] ? DeeperOmitNever[] - // Do not deep process No-Deep values - : IfNoDeepValue> extends true ? T[K] - // Deep process objects - : DeepOmitNever> + [K in keyof T as IfNever, never, K>]: Exclude< // Deep process arrays + T[K], + undefined + > extends (infer U)[] + ? DeeperOmitNever[] + : // Do not deep process No-Deep values + IfNoDeepValue> extends true + ? T[K] + : // Deep process objects + DeepOmitNever>; }; diff --git a/lib/omit.d.ts b/lib/omit.d.ts index 31c75ae..d543585 100644 --- a/lib/omit.d.ts +++ b/lib/omit.d.ts @@ -7,48 +7,58 @@ import { IfFunction, IfNever } from './type-check'; * while preserving strict type checking. */ export type StrictOmit = { - [K in keyof T as (K extends X ? never : K)]: T[K] + [K in keyof T as K extends X ? never : K]: T[K]; }; /** * Omit all function properties in T */ export type OmitFunctions = { - [K in keyof T as ( - Or< - // Omit never keys - IfNever>, - // Omit functions - IfFunction> - > extends true ? never : K - )]: T[K] + [K in keyof T as Or< + // Omit never keys + IfNever>, + // Omit functions + IfFunction> + > extends true + ? never + : K]: T[K]; }; /** * Exclude from properties of T those types that are assignable to X */ export type OmitTypes = { - [K in keyof T as (IfNever, never, K>)]: Exclude + [K in keyof T as IfNever, never, K>]: Exclude< + T[K], + X + >; }; /** * Omit all function properties in T */ export type DeepOmitTypes = { - [K in keyof T as (IfNever, never, K>)]: // Do not deep process No-Deep values - IfNoDeepValue> extends true ? Exclude - // Deep process objects - : DeepOmitTypes, X> + [K in keyof T as IfNever< + Exclude, + never, + K + >]: IfNoDeepValue> extends true // Do not deep process No-Deep values + ? Exclude + : // Deep process objects + DeepOmitTypes, X>; }; /** * Omit all function properties in T deeply including arrays */ export type DeeperOmitTypes = { - [K in keyof T as (IfNever, never, K>)]: // Do not deep process No-Deep values - // Deep process arrays - Exclude extends (infer U)[] ? DeeperOmitTypes[] - : IfNoDeepValue> extends true ? Exclude - // Deep process objects - : DeeperOmitTypes, X> + [K in keyof T as IfNever, never, K>]: Exclude< // Deep process arrays // Do not deep process No-Deep values + T[K], + undefined + > extends (infer U)[] + ? DeeperOmitTypes[] + : IfNoDeepValue> extends true + ? Exclude + : // Deep process objects + DeeperOmitTypes, X>; }; diff --git a/lib/opaque.ts b/lib/opaque.ts index b96b6cc..53d9087 100644 --- a/lib/opaque.ts +++ b/lib/opaque.ts @@ -9,4 +9,4 @@ declare namespace Symbols { export type Opaque = T & { readonly [Symbols.base]: N; readonly [Symbols.brand]: N; -} +}; diff --git a/lib/partial.d.ts b/lib/partial.d.ts index c148e81..9d2b682 100644 --- a/lib/partial.d.ts +++ b/lib/partial.d.ts @@ -5,42 +5,44 @@ import { DeepOmitRequired, DeepPickRequired, OmitRequired, - PickRequired + PickRequired, } from './required'; import { IfNever } from './type-check'; - /** * Marks given keys as optional */ -export type PartialSome = Partial> & Omit; - +export type PartialSome = Partial> & + Omit; /** * Partial but deeply */ export type DeepPartial = { - [K in keyof T as (IfNever, never, K>)]?: - // Do not deep process No-Deep values - IfNoDeepValue> extends true ? T[K] - // Deep process objects - : DeepPartial> + [K in keyof T as IfNever, never, K>]?: IfNoDeepValue< // Do not deep process No-Deep values + Exclude + > extends true + ? T[K] + : // Deep process objects + DeepPartial>; }; /** * Partial but deeply including arrays */ export type DeeperPartial = { - [K in keyof T as (IfNever, never, K>)]?: - // Deep process arrays - Exclude extends (infer U)[] ? DeeperPartial[] - // Do not deep process No-Deep values - : IfNoDeepValue> extends true ? T[K] - // Deep process objects - : DeeperPartial> + [K in keyof T as IfNever, never, K>]?: Exclude< // Deep process arrays + T[K], + undefined + > extends (infer U)[] + ? DeeperPartial[] + : // Do not deep process No-Deep values + IfNoDeepValue> extends true + ? T[K] + : // Deep process objects + DeeperPartial>; }; - /** * OptionalKeys * @desc Returns optional keys of an object diff --git a/lib/pick.d.ts b/lib/pick.d.ts index 512e500..bbed600 100644 --- a/lib/pick.d.ts +++ b/lib/pick.d.ts @@ -1,75 +1,76 @@ import { Or } from './logical.js'; import { OmitFunctions } from './omit'; -import { IfAny, IfEmptyObject, IfFunction, IfNever, IfUnknown } from './type-check'; +import { + IfAny, + IfEmptyObject, + IfFunction, + IfNever, + IfUnknown, +} from './type-check'; /** * From T, pick a set of properties whose keys are in the union K, * while preserving strict type checking. */ export type StrictPick = { - [K in keyof T as ( - Or< - // Omit never keys - IfNever>, - // Omit X - K extends X ? false : true - > extends true ? never : K - )]: T[K] + [K in keyof T as Or< + // Omit never keys + IfNever>, + // Omit X + K extends X ? false : true + > extends true + ? never + : K]: T[K]; }; /** * Pick all function properties in T */ export type PickFunctions = { - [K in keyof T as ( - Or< - // Omit never keys - IfNever>, - // Omit non functions - IfFunction, false, true> - > extends true ? never : K - )]: T[K] + [K in keyof T as Or< + // Omit never keys + IfNever>, + // Omit non functions + IfFunction, false, true> + > extends true + ? never + : K]: T[K]; }; - /** * Pick all function properties in T */ export type PickTypes = { - [K in keyof T as ( - Or< - // Omit never keys - IfNever>, - // Omit types which not exists in X - T[K] extends X ? false : - X extends T[K] ? false : true - > extends true ? never : K - )]: T[K] + [K in keyof T as Or< + // Omit never keys + IfNever>, + // Omit types which not exists in X + T[K] extends X ? false : X extends T[K] ? false : true + > extends true + ? never + : K]: T[K]; }; - /** * Pick all function properties in T */ export type StrictPickTypes = { - [K in keyof T as ( - Or< - // Omit never keys - IfNever>, - // Omit unknown - IfUnknown, - // Omit any - IfAny, - // Omit {} - IfEmptyObject, - // Omit types which not exists in X - T[K] extends X ? false : - X extends T[K] ? false : true - > extends true ? never : K - )]: T[K] + [K in keyof T as Or< + // Omit never keys + IfNever>, + // Omit unknown + IfUnknown, + // Omit any + IfAny, + // Omit {} + IfEmptyObject, + // Omit types which not exists in X + T[K] extends X ? false : X extends T[K] ? false : true + > extends true + ? never + : K]: T[K]; }; - /** * @desc Returns Function keys of an object */ @@ -80,7 +81,6 @@ export type FunctionKeys = keyof PickFunctions; */ export type NonFunctionKeys = keyof OmitFunctions; - /** * @desc Returns keys that match given type */ @@ -90,4 +90,3 @@ export type KeysOfTypes = keyof PickTypes; * @desc Returns keys that equals given type */ export type StrictKeysOfTypes = keyof StrictPickTypes; - diff --git a/lib/readonly.d.ts b/lib/readonly.d.ts index 63b400b..f45faf4 100644 --- a/lib/readonly.d.ts +++ b/lib/readonly.d.ts @@ -5,33 +5,40 @@ import { IfEquals, IfNever } from './type-check'; /** * Marks given keys as readonly */ -export type ReadonlySome = Readonly> & Omit; +export type ReadonlySome = Readonly> & + Omit; /** * Make all properties in T readonly deeply */ export type DeepReadonly = { - readonly [K in keyof T as (IfNever, never, K>)]: - // Do not deep process No-Deep values - IfNoDeepValue> extends true ? T[K] - // Deep process objects - : DeepReadonly> + readonly [K in keyof T as IfNever< + Exclude, + never, + K + >]: IfNoDeepValue> extends true // Do not deep process No-Deep values + ? T[K] + : // Deep process objects + DeepReadonly>; }; /** * Make all properties in T readonly deeply */ export type DeeperReadonly = { - readonly [K in keyof T as (IfNever, never, K>)]: - // Deep process arrays - Exclude extends (infer U)[] ? DeeperReadonly[] - // Do not deep process No-Deep values - : IfNoDeepValue> extends true ? T[K] - // Deep process objects - : DeeperReadonly> + readonly [K in keyof T as IfNever< + Exclude, + never, + K + >]: Exclude extends (infer U)[] // Deep process arrays + ? DeeperReadonly[] + : // Do not deep process No-Deep values + IfNoDeepValue> extends true + ? T[K] + : // Deep process objects + DeeperReadonly>; }; - /** * Returns readonly keys of an object */ @@ -41,103 +48,100 @@ export type ReadonlyKeys = keyof PickReadonly; * Pick all readonly properties in T */ export type PickReadonly = { - [K in keyof T as ( - Or< - // Omit never keys - IfNever>, - // Omit required - IfEquals<{ [Q in K]: T[K] }, { readonly [Q in K]: T[K] }, false, true> - > extends true ? never : K - )]: T[K] + [K in keyof T as Or< + // Omit never keys + IfNever>, + // Omit required + IfEquals<{ [Q in K]: T[K] }, { readonly [Q in K]: T[K] }, false, true> + > extends true + ? never + : K]: T[K]; }; /** * Omit all readonly properties in T */ export type OmitReadonly = { - [K in keyof T as ( - Or< - // Omit never keys - IfNever>, - // Omit required - IfEquals<{ [Q in K]: T[K] }, { readonly [Q in K]: T[K] }> - > extends true ? never : K - )]: T[K] + [K in keyof T as Or< + // Omit never keys + IfNever>, + // Omit required + IfEquals<{ [Q in K]: T[K] }, { readonly [Q in K]: T[K] }> + > extends true + ? never + : K]: T[K]; }; - /** * Pick all readonly properties in T deeply */ export type DeepPickReadonly = { - [K in keyof T as ( - Or< - // Omit never keys - IfNever>, - // Omit required - IfEquals<{ [Q in K]: T[K] }, { readonly [Q in K]: T[K] }, false, true> - > extends true ? never : K - )]: - // Do not deep process No-Deep values - IfNoDeepValue> extends true ? T[K] - // Deep process objects - : DeepPickReadonly> + [K in keyof T as Or< + // Omit never keys + IfNever>, + // Omit required + IfEquals<{ [Q in K]: T[K] }, { readonly [Q in K]: T[K] }, false, true> + > extends true + ? never + : K]: IfNoDeepValue> extends true // Do not deep process No-Deep values + ? T[K] + : // Deep process objects + DeepPickReadonly>; }; /** * Pick all readonly properties in T deeply */ export type DeepOmitReadonly = { - [K in keyof T as ( - Or< - // Omit never keys - IfNever>, - // Omit required - IfEquals<{ [Q in K]: T[K] }, { readonly [Q in K]: T[K] }> - > extends true ? never : K - )]: - // Do not deep process No-Deep values - IfNoDeepValue> extends true ? T[K] - // Deep process objects - : DeepOmitReadonly> + [K in keyof T as Or< + // Omit never keys + IfNever>, + // Omit required + IfEquals<{ [Q in K]: T[K] }, { readonly [Q in K]: T[K] }> + > extends true + ? never + : K]: IfNoDeepValue> extends true // Do not deep process No-Deep values + ? T[K] + : // Deep process objects + DeepOmitReadonly>; }; /** * Pick all readonly properties in T deeply including arrays */ export type DeeperPickReadonly = { - [K in keyof T as ( - Or< - // Omit never keys - IfNever>, - // Omit required - IfEquals<{ [Q in K]: T[K] }, { readonly [Q in K]: T[K] }, false, true> - > extends true ? never : K - )]: - // Deep process arrays - Exclude extends (infer U)[] ? DeeperPickReadonly[] - // Do not deep process No-Deep values - : IfNoDeepValue> extends true ? T[K] - // Deep process objects - : DeeperPickReadonly> + [K in keyof T as Or< + // Omit never keys + IfNever>, + // Omit required + IfEquals<{ [Q in K]: T[K] }, { readonly [Q in K]: T[K] }, false, true> + > extends true + ? never + : K]: Exclude extends (infer U)[] // Deep process arrays + ? DeeperPickReadonly[] + : // Do not deep process No-Deep values + IfNoDeepValue> extends true + ? T[K] + : // Deep process objects + DeeperPickReadonly>; }; /** * Pick all readonly properties in T deeply including arrays */ export type DeeperOmitReadonly = { - [K in keyof T as ( - Or< - // Omit never keys - IfNever>, - // Omit required - IfEquals<{ [Q in K]: T[K] }, { readonly [Q in K]: T[K] }> - > extends true ? never : K - )]: - // Deep process arrays - Exclude extends (infer U)[] ? DeeperOmitReadonly[] - // Do not deep process No-Deep values - : IfNoDeepValue> extends true ? T[K] - // Deep process objects - : DeeperOmitReadonly> + [K in keyof T as Or< + // Omit never keys + IfNever>, + // Omit required + IfEquals<{ [Q in K]: T[K] }, { readonly [Q in K]: T[K] }> + > extends true + ? never + : K]: Exclude extends (infer U)[] // Deep process arrays + ? DeeperOmitReadonly[] + : // Do not deep process No-Deep values + IfNoDeepValue> extends true + ? T[K] + : // Deep process objects + DeeperOmitReadonly>; }; diff --git a/lib/required.d.ts b/lib/required.d.ts index 4052403..7e5b722 100644 --- a/lib/required.d.ts +++ b/lib/required.d.ts @@ -6,31 +6,40 @@ import { IfEquals, IfNever } from './type-check'; /** * Marks given keys as required */ -export type RequiredSome = OmitTypes>, null> & Omit; +export type RequiredSome = OmitTypes< + Required>, + null +> & + Omit; /** * Make all properties in T required deeply */ export type DeepRequired = { - [K in keyof T as (IfNever, never, K>)]-?: - // Do not deep process No-Deep values - IfNoDeepValue> extends true ? Exclude - // Deep process objects - : DeepRequired> + [K in keyof T as IfNever< + Exclude, + never, + K + >]-?: IfNoDeepValue> extends true // Do not deep process No-Deep values + ? Exclude + : // Deep process objects + DeepRequired>; }; - /** * Make all properties in T required deeply including arrays */ export type DeeperRequired = { - [K in keyof T as (IfNever, never, K>)]-?: - // Deep process arrays - Exclude extends (infer U)[] ? DeeperRequired[] - // Do not deep process No-Deep values - : IfNoDeepValue> extends true ? Exclude - // Deep process objects - : DeepRequired> + [K in keyof T as IfNever, never, K>]-?: Exclude< // Deep process arrays + T[K], + undefined + > extends (infer U)[] + ? DeeperRequired[] + : // Do not deep process No-Deep values + IfNoDeepValue> extends true + ? Exclude + : // Deep process objects + DeepRequired>; }; /** @@ -39,107 +48,104 @@ export type DeeperRequired = { */ export type RequiredKeys = keyof PickRequired; - /** * Pick all required properties in T */ export type PickRequired = { - [K in keyof T as ( - Or< - // Omit never keys - IfNever>, - // Omit optional - IfEquals<{ [Q in K]: T[K] }, { [Q in K]?: T[K] }> - > extends true ? never : K - )]: T[K] + [K in keyof T as Or< + // Omit never keys + IfNever>, + // Omit optional + IfEquals<{ [Q in K]: T[K] }, { [Q in K]?: T[K] }> + > extends true + ? never + : K]: T[K]; }; /** * Pick all required properties in T */ export type OmitRequired = { - [K in keyof T as ( - Or< - // Omit never keys - IfNever>, - // Omit optional - IfEquals<{ [Q in K]: T[K] }, { [Q in K]?: T[K] }, false, true> - > extends true ? never : K - )]: T[K] + [K in keyof T as Or< + // Omit never keys + IfNever>, + // Omit optional + IfEquals<{ [Q in K]: T[K] }, { [Q in K]?: T[K] }, false, true> + > extends true + ? never + : K]: T[K]; }; /** * Pick all required properties in T deeply */ export type DeepPickRequired = { - [K in keyof T as ( - Or< - // Omit never keys - IfNever>, - // Omit optional - IfEquals<{ [Q in K]: T[K] }, { [Q in K]?: T[K] }> - > extends true ? never : K - )]: - // Do not deep process No-Deep values - IfNoDeepValue> extends true ? T[K] - // Deep process objects - : DeepPickRequired> + [K in keyof T as Or< + // Omit never keys + IfNever>, + // Omit optional + IfEquals<{ [Q in K]: T[K] }, { [Q in K]?: T[K] }> + > extends true + ? never + : K]: IfNoDeepValue> extends true // Do not deep process No-Deep values + ? T[K] + : // Deep process objects + DeepPickRequired>; }; /** * Omit all required properties in T deeply */ export type DeepOmitRequired = { - [K in keyof T as ( - Or< - // Omit never keys - IfNever>, - // Omit required - IfEquals<{ [Q in K]: T[K] }, { [Q in K]-?: T[K] }> - > extends true ? never : K - )]?: - // Do not deep process No-Deep values - IfNoDeepValue> extends true ? T[K] - // Deep process objects - : DeepOmitRequired> + [K in keyof T as Or< + // Omit never keys + IfNever>, + // Omit required + IfEquals<{ [Q in K]: T[K] }, { [Q in K]-?: T[K] }> + > extends true + ? never + : K]?: IfNoDeepValue> extends true // Do not deep process No-Deep values + ? T[K] + : // Deep process objects + DeepOmitRequired>; }; /** * Pick all required properties in T deeply including arrays */ export type DeeperPickRequired = { - [K in keyof T as ( - Or< - // Omit never keys - IfNever>, - // Omit required - IfEquals<{ [Q in K]: T[K] }, { [Q in K]?: T[K] }> - > extends true ? never : K - )]: - // Deep process arrays - Exclude extends (infer U)[] ? DeeperPickRequired[] - // Do not deep process No-Deep values - : IfNoDeepValue> extends true ? T[K] - // Deep process objects - : DeeperPickRequired> + [K in keyof T as Or< + // Omit never keys + IfNever>, + // Omit required + IfEquals<{ [Q in K]: T[K] }, { [Q in K]?: T[K] }> + > extends true + ? never + : K]: Exclude extends (infer U)[] // Deep process arrays + ? DeeperPickRequired[] + : // Do not deep process No-Deep values + IfNoDeepValue> extends true + ? T[K] + : // Deep process objects + DeeperPickRequired>; }; /** * Omit all required properties in T deeply including arrays */ export type DeeperOmitRequired = { - [K in keyof T as ( - Or< - // Omit never keys - IfNever>, - // Omit required - IfEquals<{ [Q in K]: T[K] }, { [Q in K]-?: T[K] }> - > extends true ? never : K - )]: - // Deep process arrays - Exclude extends (infer U)[] ? DeeperOmitRequired[] - // Do not deep process No-Deep values - : IfNoDeepValue> extends true ? T[K] - // Deep process objects - : DeeperOmitRequired> + [K in keyof T as Or< + // Omit never keys + IfNever>, + // Omit required + IfEquals<{ [Q in K]: T[K] }, { [Q in K]-?: T[K] }> + > extends true + ? never + : K]: Exclude extends (infer U)[] // Deep process arrays + ? DeeperOmitRequired[] + : // Do not deep process No-Deep values + IfNoDeepValue> extends true + ? T[K] + : // Deep process objects + DeeperOmitRequired>; }; diff --git a/lib/type-check.d.ts b/lib/type-check.d.ts index 88d5e0f..401f1c0 100644 --- a/lib/type-check.d.ts +++ b/lib/type-check.d.ts @@ -5,150 +5,190 @@ type NonObj = Primitive | Function; /** * Returns Y if typeof T is "any", N otherwise */ -export type IfAny = - 0 extends 1 & T ? Y : N; +export type IfAny = 0 extends 1 & T ? Y : N; /** * Returns "Y" if "T" is "never", "N" otherwise */ -export type IfNever = - [T] extends [never] ? Y : N; +export type IfNever = [T] extends [never] ? Y : N; /** * Returns Y if T is undefined, N otherwise */ -export type IfUndefined = - IfEquals; +export type IfUndefined = IfEquals; /** * Returns "Y" if "T" is "never", "N" otherwise */ -export type IfSymbol = - IfEquals; +export type IfSymbol = IfEquals; /** * Returns Y if typeof T is "unknown", N otherwise */ -export type IfUnknown = - IfEquals; +export type IfUnknown = IfEquals; /** * Returns Y if typeof T is null, N otherwise */ -export type IfNull = - IfEquals; +export type IfNull = IfEquals; /** * Returns Y if typeof T is null, N otherwise */ export type IfNullish = - IfNever extends true ? N - : T extends null ? Y - : T extends undefined ? Y : N; - + IfNever extends true + ? N + : T extends null + ? Y + : T extends undefined + ? Y + : N; /** * Returns Y if typeof T is a tuple, N otherwise */ export type IfTuple = - IfEquals extends true - ? T extends [any] - ? number extends T['length'] ? N : Y - : N : N; + IfEquals extends true + ? T extends [any] + ? number extends T['length'] + ? N + : Y + : N + : N; export type IfTupleOrAny = - IfAny extends true ? Y : IfTuple; + IfAny extends true ? Y : IfTuple; /** * Returns Y if typeof T is "Primitive", N otherwise */ export type IfPrimitive = - IfNever extends true ? N : - IfNull extends true ? Y : - IfUndefined extends true ? Y : - IfClass extends true ? N : - IfFunction extends true ? N : - T extends Primitive ? Y : - N; + IfNever extends true + ? N + : IfNull extends true + ? Y + : IfUndefined extends true + ? Y + : IfClass extends true + ? N + : IfFunction extends true + ? N + : T extends Primitive + ? Y + : N; export type IfPrimitiveOrAny = - IfAny extends true ? Y : IfPrimitive; + IfAny extends true ? Y : IfPrimitive; /** * Returns Y if typeof T is an empty object, N otherwise */ -export type IfEmptyObject = - IfEquals; +export type IfEmptyObject = IfEquals; /** * Returns Y if typeof T is an object, N otherwise */ export type IfObject = - IfNever extends true ? N - : T extends object - ? T extends NonObj | any[] - ? N - : Y - : N; + IfNever extends true + ? N + : T extends object + ? T extends NonObj | any[] + ? N + : Y + : N; export type IfObjectOrAny = - IfAny extends true ? Y : IfObject; + IfAny extends true ? Y : IfObject; /** * Returns Y if typeof T is an empty object, N otherwise */ export type IfFunction = - IfNever extends true ? N - : T extends Type ? N - : T extends Function ? Y - : N; + IfNever extends true ? N : T extends Type ? N : T extends Function ? Y : N; export type IfFunctionOrAny = - IfAny extends true ? Y : IfFunction; + IfAny extends true ? Y : IfFunction; /** * Returns Y if typeof T is a constructor type, N otherwise */ export type IfClass = - IfNever extends true ? N - : IfUndefined extends true ? N - : T extends Type ? Y : N; + IfNever extends true + ? N + : IfUndefined extends true + ? N + : T extends Type + ? Y + : N; export type IfClassOrAny = - IfAny extends true ? Y : IfClass; - + IfAny extends true ? Y : IfClass; /** * Returns "Y" if "T1" is exactly same with "T2", "N" otherwise */ export type IfEquals = - IfObject | IfObject extends true - ? ((() => G extends EqualsWrapped ? 1 : 2) extends (() => G extends EqualsWrapped ? 1 : 2) ? Y : N) - : ((() => G extends T1 ? 1 : 2) extends (() => G extends T2 ? 1 : 2) ? Y : N); + | IfObject + | IfObject extends true + ? (() => G extends EqualsWrapped ? 1 : 2) extends < + G, + >() => G extends EqualsWrapped ? 1 : 2 + ? Y + : N + : (() => G extends T1 ? 1 : 2) extends () => G extends T2 ? 1 : 2 + ? Y + : N; type EqualsWrapped = T extends infer R & {} - ? { [P in keyof R]: R[P] } - : never; + ? { [P in keyof R]: R[P] } + : never; /** * Returns "Y" if type "T" matches "U", "N" otherwise */ export type IfCompatible = - IfUndefined extends true ? IfEquals : IfUndefined extends true ? N - : IfNever extends true ? IfEquals : IfNever extends true ? N - : IfNull extends true ? IfEquals : IfNull extends true ? N - : IfUnknown extends true ? Y : IfUnknown extends true ? Y - : IfAny extends true ? Y : IfAny extends true ? Y - : IfEmptyObject extends true ? IfObject - : IfEmptyObject extends true ? IfObject - : IfFunction extends true ? IfCompatibleFunction - : IfObject extends true ? [T1] extends [T2] ? Y : N - : [T1] extends [T2] ? Y - : IfPrimitive extends true ? [T2] extends [T1] ? Y - : N : N; + IfUndefined extends true + ? IfEquals + : IfUndefined extends true + ? N + : IfNever extends true + ? IfEquals + : IfNever extends true + ? N + : IfNull extends true + ? IfEquals + : IfNull extends true + ? N + : IfUnknown extends true + ? Y + : IfUnknown extends true + ? Y + : IfAny extends true + ? Y + : IfAny extends true + ? Y + : IfEmptyObject extends true + ? IfObject + : IfEmptyObject extends true + ? IfObject + : IfFunction extends true + ? IfCompatibleFunction + : IfObject extends true + ? [T1] extends [T2] + ? Y + : N + : [T1] extends [T2] + ? Y + : IfPrimitive extends true + ? [T2] extends [T1] + ? Y + : N + : N; type IfCompatibleFunction = - IfFunction extends false ? N - : IfFunction extends false ? N - : T1 extends T2 - ? Y - : N; + IfFunction extends false + ? N + : IfFunction extends false + ? N + : T1 extends T2 + ? Y + : N; diff --git a/lib/types.d.ts b/lib/types.d.ts index 93d3129..41fe6a8 100644 --- a/lib/types.d.ts +++ b/lib/types.d.ts @@ -13,11 +13,13 @@ declare global { cancel(reason?: any): Promise; - getReader(options: { mode: "byob" }): ReadableStreamBYOBReader; + getReader(options: { mode: 'byob' }): ReadableStreamBYOBReader; getReader(): ReadableStreamDefaultReader; - getReader(options?: ReadableStreamGetReaderOptions): ReadableStreamReader; + getReader( + options?: ReadableStreamGetReaderOptions, + ): ReadableStreamReader; } export interface WritableStream { @@ -35,7 +37,6 @@ declare global { */ type BasicPrimitive = number | string | boolean; - /** * Primitive * @desc Type representing [`Primitive`](https://developer.mozilla.org/en-US/docs/Glossary/Primitive) types @@ -47,33 +48,52 @@ export type Primitive = BasicPrimitive | null | bigint | symbol | undefined; * JsonTypes * @desc Type representing JSON types in TypeScript */ -type JsonType = BasicPrimitive | null | object | (BasicPrimitive | object)[] - +type JsonType = BasicPrimitive | null | object | (BasicPrimitive | object)[]; /** * Builtin * @desc Type representing Builtin types in JavaScript */ -export type Builtin = Primitive | Function | String | Number | Date | Error | RegExp | - Buffer | ArrayBuffer | Int8Array | Uint8Array | Uint8ClampedArray | - Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array | - URL | ReadableStream | WritableStream; +export type Builtin = + | Primitive + | Function + | String + | Number + | Date + | Error + | RegExp + | Buffer + | ArrayBuffer + | Int8Array + | Uint8Array + | Uint8ClampedArray + | Int16Array + | Uint16Array + | Int32Array + | Uint32Array + | Float32Array + | Float64Array + | URL + | ReadableStream + | WritableStream; /** * Type * @desc Represents constructor of type T */ export interface Type { - new(...args: any[]): T; + new (...args: any[]): T; } /** * Class * @desc Represents Class constructor of type T */ -export type Class = - (new(...args: Args) => Instance) & Static; - +export type Class< + Args extends any[] = any[], + Instance = {}, + Static = {}, +> = (new (...args: Args) => Instance) & Static; /** * Maybe @@ -87,18 +107,15 @@ export type Maybe = T | undefined; */ export type Nullish = T | undefined | null; - export type Awaited = T extends PromiseLike ? U : T; - export type Thunk = T | (() => T); -export type ThunkAsync = Thunk | (() => Promise) +export type ThunkAsync = Thunk | (() => Promise); export type TypeThunk = Thunk>; export type TypeThunkAsync = ThunkAsync>; export type MaybePromise = T | Promise; - /** * PropertyType * @desc Returns the type of property at a given key `K` @@ -109,5 +126,7 @@ export type PropertyType = T[K]; * $ElementType * @desc Returns the type of elements inside of array, tuple or object of type `T`, that matches the given index type `K` */ -export type ElementType = T[K]; +export type ElementType< + T extends { [P in K & any]: any }, + K extends keyof T | number, +> = T[K]; diff --git a/package-lock.json b/package-lock.json index 2d6cc41..b6fce87 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,8 +10,15 @@ "license": "MIT", "devDependencies": { "@types/jest": "^29.5.12", - "eslint": "^9.0.0", + "eslint": "^8.57.0", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-import": "^2.29.1", + "eslint-plugin-prettier": "^5.1.3", + "eslint-plugin-security": "^3.0.0", + "eslint-plugin-simple-import-sort": "^12.1.0", + "eslint-plugin-unused-imports": "^3.1.0", "jest": "^29.7.0", + "prettier": "^3.2.5", "ts-jest": "^29.1.2", "typescript": "^5.4.5" } @@ -624,15 +631,15 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.0.2.tgz", - "integrity": "sha512-wV19ZEGEMAC1eHgrS7UQPqsdEiCIbTKTasEfcXAigzoXICcqZSjBZEHlZwNVvKg6UBCjSlos84XiLqsRJnIcIg==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", "dev": true, "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^10.0.1", - "globals": "^14.0.0", + "espree": "^9.6.0", + "globals": "^13.19.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", @@ -640,28 +647,28 @@ "strip-json-comments": "^3.1.1" }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "url": "https://opencollective.com/eslint" } }, "node_modules/@eslint/js": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.0.0.tgz", - "integrity": "sha512-RThY/MnKrhubF6+s1JflwUjPEsnCEmYCWwqa/aRISKWNXGZ9epUwft4bUMM35SdKF9xvBrLydAM1RDHd1Z//ZQ==", + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", + "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", "dev": true, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, "node_modules/@humanwhocodes/config-array": { - "version": "0.12.3", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.12.3.tgz", - "integrity": "sha512-jsNnTBlMWuTpDkeE3on7+dWJi0D6fdDfeANj/w7MpS8ztROCoLvIO2nG0CcFj+E4k8j4QrSTh4Oryi3i2G669g==", + "version": "0.11.14", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", + "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", "dev": true, "dependencies": { - "@humanwhocodes/object-schema": "^2.0.3", + "@humanwhocodes/object-schema": "^2.0.2", "debug": "^4.3.1", "minimatch": "^3.0.5" }, @@ -1157,6 +1164,18 @@ "node": ">= 8" } }, + "node_modules/@pkgr/core": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.1.1.tgz", + "integrity": "sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, "node_modules/@sinclair/typebox": { "version": "0.27.8", "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", @@ -1265,6 +1284,12 @@ "pretty-format": "^29.0.0" } }, + "node_modules/@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", + "dev": true + }, "node_modules/@types/node": { "version": "20.12.7", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.7.tgz", @@ -1295,6 +1320,12 @@ "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", "dev": true }, + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "dev": true + }, "node_modules/acorn": { "version": "8.11.3", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", @@ -1347,18 +1378,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/ansi-escapes/node_modules/type-fest": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", @@ -1402,6 +1421,135 @@ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, + "node_modules/array-buffer-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", + "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.5", + "is-array-buffer": "^3.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array-includes": { + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.8.tgz", + "integrity": "sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.4", + "is-string": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.findlastindex": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.5.tgz", + "integrity": "sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flat": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz", + "integrity": "sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-shim-unscopables": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flatmap": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.2.tgz", + "integrity": "sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-shim-unscopables": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz", + "integrity": "sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==", + "dev": true, + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.2.1", + "get-intrinsic": "^1.2.3", + "is-array-buffer": "^3.0.4", + "is-shared-array-buffer": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/babel-jest": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", @@ -1596,6 +1744,25 @@ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true }, + "node_modules/call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -1615,9 +1782,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001610", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001610.tgz", - "integrity": "sha512-QFutAY4NgaelojVMjY63o6XlZyORPaLfyMnsl3HgnWdJUcX6K0oaJymHjH8PT5Gk7sTm8rvC/c5COUQKXqmOMA==", + "version": "1.0.30001612", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001612.tgz", + "integrity": "sha512-lFgnZ07UhaCcsSZgWW0K5j4e69dK1u/ltrL9lTUiFOwNHs12S3UMIEYgBV0Z6C6hRDev7iRnMzzYmKabYdXF9g==", "dev": true, "funding": [ { @@ -1775,6 +1942,57 @@ "node": ">= 8" } }, + "node_modules/data-view-buffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", + "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz", + "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz", + "integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -1821,6 +2039,40 @@ "node": ">=0.10.0" } }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dev": true, + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/detect-newline": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", @@ -1839,10 +2091,22 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/electron-to-chromium": { - "version": "1.4.737", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.737.tgz", - "integrity": "sha512-QvLTxaLHKdy5YxvixAw/FfHq2eWLUL9KvsPjp0aHK1gI5d3EDuDgITkvj0nFO2c6zUY3ZqVAJQiBYyQP9tQpfw==", + "version": "1.4.748", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.748.tgz", + "integrity": "sha512-VWqjOlPZn70UZ8FTKUOkUvBLeTQ0xpty66qV0yJcAGY2/CthI4xyW9aEozRVtuwv3Kpf5xTesmJUcPwuJmgP4A==", "dev": true }, "node_modules/emittery": { @@ -1872,6 +2136,139 @@ "is-arrayish": "^0.2.1" } }, + "node_modules/es-abstract": { + "version": "1.23.3", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.3.tgz", + "integrity": "sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==", + "dev": true, + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "arraybuffer.prototype.slice": "^1.0.3", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "data-view-buffer": "^1.0.1", + "data-view-byte-length": "^1.0.1", + "data-view-byte-offset": "^1.0.0", + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-set-tostringtag": "^2.0.3", + "es-to-primitive": "^1.2.1", + "function.prototype.name": "^1.1.6", + "get-intrinsic": "^1.2.4", + "get-symbol-description": "^1.0.2", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.0.3", + "has-symbols": "^1.0.3", + "hasown": "^2.0.2", + "internal-slot": "^1.0.7", + "is-array-buffer": "^3.0.4", + "is-callable": "^1.2.7", + "is-data-view": "^1.0.1", + "is-negative-zero": "^2.0.3", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.3", + "is-string": "^1.0.7", + "is-typed-array": "^1.1.13", + "is-weakref": "^1.0.2", + "object-inspect": "^1.13.1", + "object-keys": "^1.1.1", + "object.assign": "^4.1.5", + "regexp.prototype.flags": "^1.5.2", + "safe-array-concat": "^1.1.2", + "safe-regex-test": "^1.0.3", + "string.prototype.trim": "^1.2.9", + "string.prototype.trimend": "^1.0.8", + "string.prototype.trimstart": "^1.0.8", + "typed-array-buffer": "^1.0.2", + "typed-array-byte-length": "^1.0.1", + "typed-array-byte-offset": "^1.0.2", + "typed-array-length": "^1.0.6", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.15" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", + "integrity": "sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.4", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-shim-unscopables": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz", + "integrity": "sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==", + "dev": true, + "dependencies": { + "hasown": "^2.0.0" + } + }, + "node_modules/es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/escalade": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", @@ -1894,37 +2291,41 @@ } }, "node_modules/eslint": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.0.0.tgz", - "integrity": "sha512-IMryZ5SudxzQvuod6rUdIUz29qFItWx281VhtFVc2Psy/ZhlCeD/5DT6lBIJ4H3G+iamGJoTln1v+QSuPw0p7Q==", + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", + "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^3.0.2", - "@eslint/js": "9.0.0", - "@humanwhocodes/config-array": "^0.12.3", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.0", + "@humanwhocodes/config-array": "^0.11.14", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "debug": "^4.3.2", + "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^8.0.1", - "eslint-visitor-keys": "^4.0.0", - "espree": "^10.0.1", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^8.0.0", + "file-entry-cache": "^6.0.1", "find-up": "^5.0.0", "glob-parent": "^6.0.2", + "globals": "^13.19.0", "graphemer": "^1.4.0", "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", @@ -1938,76 +2339,243 @@ "eslint": "bin/eslint.js" }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint-scope": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.0.1.tgz", - "integrity": "sha512-pL8XjgP4ZOmmwfFE8mEhSxA7ZY4C+LWyqjQ3o4yWkkmD0qcMT9kkW3zWHOczhWcjTSgqycYAgwSlXvZltv65og==", + "node_modules/eslint-config-prettier": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", + "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==", "dev": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "bin": { + "eslint-config-prettier": "bin/cli.js" }, - "funding": { - "url": "https://opencollective.com/eslint" + "peerDependencies": { + "eslint": ">=7.0.0" } }, - "node_modules/eslint-visitor-keys": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", - "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "node_modules/eslint-import-resolver-node": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", + "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" + "dependencies": { + "debug": "^3.2.7", + "is-core-module": "^2.13.0", + "resolve": "^1.22.4" } }, - "node_modules/eslint/node_modules/eslint-visitor-keys": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz", - "integrity": "sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==", + "node_modules/eslint-import-resolver-node/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-module-utils": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.1.tgz", + "integrity": "sha512-rXDXR3h7cs7dy9RNpUlQf80nX31XWJEyGq1tRMo+6GsO5VmTe4UTwtmonAD4ZkAsrfMVDA2wlGJ3790Ys+D49Q==", + "dev": true, + "dependencies": { + "debug": "^3.2.7" + }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": ">=4" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } + } + }, + "node_modules/eslint-module-utils/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-plugin-import": { + "version": "2.29.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.29.1.tgz", + "integrity": "sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==", + "dev": true, + "dependencies": { + "array-includes": "^3.1.7", + "array.prototype.findlastindex": "^1.2.3", + "array.prototype.flat": "^1.3.2", + "array.prototype.flatmap": "^1.3.2", + "debug": "^3.2.7", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.9", + "eslint-module-utils": "^2.8.0", + "hasown": "^2.0.0", + "is-core-module": "^2.13.1", + "is-glob": "^4.0.3", + "minimatch": "^3.1.2", + "object.fromentries": "^2.0.7", + "object.groupby": "^1.0.1", + "object.values": "^1.1.7", + "semver": "^6.3.1", + "tsconfig-paths": "^3.15.0" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" + } + }, + "node_modules/eslint-plugin-import/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-plugin-import/node_modules/doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eslint-plugin-prettier": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.1.3.tgz", + "integrity": "sha512-C9GCVAs4Eq7ZC/XFQHITLiHJxQngdtraXaM+LoUFoFp/lHNl2Zn8f3WQbe9HvTBBQ9YnKFB0/2Ajdqwo5D1EAw==", + "dev": true, + "dependencies": { + "prettier-linter-helpers": "^1.0.0", + "synckit": "^0.8.6" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" }, "funding": { - "url": "https://opencollective.com/eslint" + "url": "https://opencollective.com/eslint-plugin-prettier" + }, + "peerDependencies": { + "@types/eslint": ">=8.0.0", + "eslint": ">=8.0.0", + "eslint-config-prettier": "*", + "prettier": ">=3.0.0" + }, + "peerDependenciesMeta": { + "@types/eslint": { + "optional": true + }, + "eslint-config-prettier": { + "optional": true + } } }, - "node_modules/espree": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-10.0.1.tgz", - "integrity": "sha512-MWkrWZbJsL2UwnjxTX3gG8FneachS/Mwg7tdGXce011sJd5b0JG54vat5KHnfSBODZ3Wvzd2WnjxyzsRoVv+ww==", + "node_modules/eslint-plugin-security": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-security/-/eslint-plugin-security-3.0.0.tgz", + "integrity": "sha512-2Ij7PkmXIF2cKwoVkEgemwoXbOnxg5UfdhdcpNxZwJxC/10dbsdhHISrTyJ/n8DUkt3yiN6P1ywEgcMGjIwHIw==", "dev": true, "dependencies": { - "acorn": "^8.11.3", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^4.0.0" + "safe-regex": "^2.1.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/eslint-plugin-simple-import-sort": { + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-12.1.0.tgz", + "integrity": "sha512-Y2fqAfC11TcG/WP3TrI1Gi3p3nc8XJyEOJYHyEPEGI/UAgNx6akxxlX74p7SbAQdLcgASKhj8M0GKvH3vq/+ig==", + "dev": true, + "peerDependencies": { + "eslint": ">=5.0.0" + } + }, + "node_modules/eslint-plugin-unused-imports": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-3.1.0.tgz", + "integrity": "sha512-9l1YFCzXKkw1qtAru1RWUtG2EVDZY0a0eChKXcL+EZ5jitG7qxdctu4RnvhOJHv4xfmUf7h+JJPINlVpGhZMrw==", + "dev": true, + "dependencies": { + "eslint-rule-composer": "^0.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "@typescript-eslint/eslint-plugin": "6 - 7", + "eslint": "8" + }, + "peerDependenciesMeta": { + "@typescript-eslint/eslint-plugin": { + "optional": true + } + } + }, + "node_modules/eslint-rule-composer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz", + "integrity": "sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg==", + "dev": true, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "url": "https://opencollective.com/eslint" } }, - "node_modules/espree/node_modules/eslint-visitor-keys": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz", - "integrity": "sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==", + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "dev": true, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "dev": true, + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "url": "https://opencollective.com/eslint" @@ -2122,6 +2690,12 @@ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, + "node_modules/fast-diff": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", + "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", + "dev": true + }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", @@ -2153,15 +2727,15 @@ } }, "node_modules/file-entry-cache": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", - "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", "dev": true, "dependencies": { - "flat-cache": "^4.0.0" + "flat-cache": "^3.0.4" }, "engines": { - "node": ">=16.0.0" + "node": "^10.12.0 || >=12.0.0" } }, "node_modules/fill-range": { @@ -2193,16 +2767,17 @@ } }, "node_modules/flat-cache": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", - "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", "dev": true, "dependencies": { "flatted": "^3.2.9", - "keyv": "^4.5.4" + "keyv": "^4.5.3", + "rimraf": "^3.0.2" }, "engines": { - "node": ">=16" + "node": "^10.12.0 || >=12.0.0" } }, "node_modules/flatted": { @@ -2211,6 +2786,15 @@ "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", "dev": true }, + "node_modules/for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.3" + } + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -2240,6 +2824,33 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/function.prototype.name": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", + "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "functions-have-names": "^1.2.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -2258,6 +2869,25 @@ "node": "6.* || 8.* || >= 10.*" } }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/get-package-type": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", @@ -2279,6 +2909,23 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/get-symbol-description": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", + "integrity": "sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -2312,17 +2959,59 @@ } }, "node_modules/globals": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", - "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, "engines": { - "node": ">=18" + "node": ">=8" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/globals/node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globalthis": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", + "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", + "dev": true, + "dependencies": { + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -2335,6 +3024,15 @@ "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", "dev": true }, + "node_modules/has-bigints": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -2344,6 +3042,57 @@ "node": ">=8" } }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/hasown": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", @@ -2440,12 +3189,82 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, + "node_modules/internal-slot": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", + "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "hasown": "^2.0.0", + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/is-array-buffer": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", + "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", "dev": true }, + "node_modules/is-bigint": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "dev": true, + "dependencies": { + "has-bigints": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-boolean-object": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-core-module": { "version": "2.13.1", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", @@ -2458,6 +3277,36 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-data-view": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz", + "integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==", + "dev": true, + "dependencies": { + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-date-object": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -2497,6 +3346,18 @@ "node": ">=0.10.0" } }, + "node_modules/is-negative-zero": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", + "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -2506,6 +3367,21 @@ "node": ">=0.12.0" } }, + "node_modules/is-number-object": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-path-inside": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", @@ -2515,6 +3391,37 @@ "node": ">=8" } }, + "node_modules/is-regex": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", + "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-stream": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", @@ -2527,6 +3434,69 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/is-string": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-symbol": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-typed-array": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", + "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", + "dev": true, + "dependencies": { + "which-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakref": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -3471,6 +4441,15 @@ "node": "*" } }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -3495,25 +4474,110 @@ "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==", "dev": true }, - "node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/object-inspect": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", + "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.fromentries": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz", + "integrity": "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.groupby": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.3.tgz", + "integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==", "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2" + }, "engines": { - "node": ">=0.10.0" + "node": ">= 0.4" } }, - "node_modules/npm-run-path": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", - "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "node_modules/object.values": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.0.tgz", + "integrity": "sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ==", "dev": true, "dependencies": { - "path-key": "^3.0.0" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" }, "engines": { - "node": ">=8" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/once": { @@ -3750,6 +4814,15 @@ "node": ">=8" } }, + "node_modules/possible-typed-array-names": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", + "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -3759,6 +4832,33 @@ "node": ">= 0.8.0" } }, + "node_modules/prettier": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", + "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", + "dev": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dev": true, + "dependencies": { + "fast-diff": "^1.1.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/pretty-format": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", @@ -3849,6 +4949,33 @@ "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", "dev": true }, + "node_modules/regexp-tree": { + "version": "0.1.27", + "resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.27.tgz", + "integrity": "sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA==", + "dev": true, + "bin": { + "regexp-tree": "bin/regexp-tree" + } + }, + "node_modules/regexp.prototype.flags": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", + "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "set-function-name": "^2.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -3924,6 +5051,21 @@ "node": ">=0.10.0" } }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -3947,6 +5089,50 @@ "queue-microtask": "^1.2.2" } }, + "node_modules/safe-array-concat": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz", + "integrity": "sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "get-intrinsic": "^1.2.4", + "has-symbols": "^1.0.3", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-2.1.1.tgz", + "integrity": "sha512-rx+x8AMzKb5Q5lQ95Zoi6ZbJqwCLkqi3XuJXp5P3rT8OEc6sZCJG5AE5dU3lsgRr/F4Bs31jSlVN+j5KrsGu9A==", + "dev": true, + "dependencies": { + "regexp-tree": "~0.1.1" + } + }, + "node_modules/safe-regex-test": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz", + "integrity": "sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-regex": "^1.1.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", @@ -3956,6 +5142,38 @@ "semver": "bin/semver.js" } }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-function-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", + "dev": true, + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -3977,6 +5195,24 @@ "node": ">=8" } }, + "node_modules/side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", @@ -4071,6 +5307,55 @@ "node": ">=8" } }, + "node_modules/string.prototype.trim": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", + "integrity": "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.0", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz", + "integrity": "sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -4137,6 +5422,22 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/synckit": { + "version": "0.8.8", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.8.8.tgz", + "integrity": "sha512-HwOKAP7Wc5aRGYdKH+dw0PRRpbO841v2DENBtjnR5HFWoiNByAl7vrx3p0G/rCyYXQsrxqtX48TImFtPcIHSpQ==", + "dev": true, + "dependencies": { + "@pkgr/core": "^0.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, "node_modules/test-exclude": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", @@ -4260,6 +5561,45 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true }, + "node_modules/tsconfig-paths": { + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", + "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", + "dev": true, + "dependencies": { + "@types/json5": "^0.0.29", + "json5": "^1.0.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + } + }, + "node_modules/tsconfig-paths/node_modules/json5": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" + } + }, + "node_modules/tsconfig-paths/node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true + }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -4281,6 +5621,91 @@ "node": ">=4" } }, + "node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typed-array-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz", + "integrity": "sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz", + "integrity": "sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.2.tgz", + "integrity": "sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-length": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.6.tgz", + "integrity": "sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/typescript": { "version": "5.4.5", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", @@ -4294,6 +5719,21 @@ "node": ">=14.17" } }, + "node_modules/unbox-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", + "which-boxed-primitive": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/undici-types": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", @@ -4377,6 +5817,41 @@ "node": ">= 8" } }, + "node_modules/which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dev": true, + "dependencies": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", + "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", diff --git a/package.json b/package.json index d783244..c90295f 100644 --- a/package.json +++ b/package.json @@ -13,17 +13,19 @@ "underscore" ], "version": "3.3.0", + "type": "module", + "module": "lib/index.mjs", + "main": "lib/index.cjs", "types": "lib/index.d.ts", - "main": "lib/index.js", - "module": "lib/index.js", "repository": "git@github.com:panates/ts-gems.git", "author": "Eray Hanoglu ", "license": "MIT", "scripts": { "compile": "tsc -b tsconfig.json", "lint": "eslint --no-error-on-unmatched-pattern", - "test:common": "jest --clearCache && jest --config=./jest.config.js", - "test:nostrict": "jest --clearCache && jest --config=./jest.nostrict.config.js", + "format": "prettier . --write --log-level=warn", + "test:common": "jest --clearCache && jest --config=./jest.config.mjs", + "test:nostrict": "jest --clearCache && jest --config=./jest.nostrict.config.mjs", "test": "npm run test:common && npm run test:nostrict" }, "files": [ @@ -33,8 +35,15 @@ ], "devDependencies": { "@types/jest": "^29.5.12", - "eslint": "^9.0.0", + "eslint": "^8.57.0", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-import": "^2.29.1", + "eslint-plugin-prettier": "^5.1.3", + "eslint-plugin-security": "^3.0.0", + "eslint-plugin-simple-import-sort": "^12.1.0", + "eslint-plugin-unused-imports": "^3.1.0", "jest": "^29.7.0", + "prettier": "^3.2.5", "ts-jest": "^29.1.2", "typescript": "^5.4.5" } diff --git a/test/_support/asserts.ts b/test/_support/asserts.ts index 4961fa4..bf02f80 100644 --- a/test/_support/asserts.ts +++ b/test/_support/asserts.ts @@ -1,4 +1,4 @@ -import {IfEquals} from '../../lib'; +import { IfEquals } from '../../lib'; // noinspection JSUnusedLocalSymbols export function exact(result: IfEquals) { diff --git a/test/combine.spec.ts b/test/combine.spec.ts index 1a5ddfa..593b6eb 100644 --- a/test/combine.spec.ts +++ b/test/combine.spec.ts @@ -2,39 +2,42 @@ import { exact } from './_support/asserts'; import { Combine } from '../lib'; describe('Combine', function () { - test('Combine', () => { type I1 = { a: string; b: boolean; - c?: number - } + c?: number; + }; type I2 = { b: string; d?: Function; - } + }; type I3 = { b: Date; e?: boolean; - } - - exact, { - a: string; - b: boolean; - c?: number; - d?: Function; - }>(true); - - exact, { - a: string; - b: boolean; - c?: number; - d?: Function; - e?: boolean; - }>(true); - + }; + + exact< + Combine, + { + a: string; + b: boolean; + c?: number; + d?: Function; + } + >(true); + + exact< + Combine, + { + a: string; + b: boolean; + c?: number; + d?: Function; + e?: boolean; + } + >(true); }); - }); diff --git a/test/helpers.spec.ts b/test/helpers.spec.ts index 83fc08d..99fc360 100644 --- a/test/helpers.spec.ts +++ b/test/helpers.spec.ts @@ -2,10 +2,15 @@ import { exact } from './_support/asserts'; import { ValuesOf } from '../lib'; describe('Keys', function () { - test('ValuesOf', () => { - type I1 = { a: number; b?: undefined; c?: {}, d: undefined, e: null, f: never }; + type I1 = { + a: number; + b?: undefined; + c?: {}; + d: undefined; + e: null; + f: never; + }; exact, number | undefined | null | {}>(true); }); - }); diff --git a/test/logical.spec.ts b/test/logical.spec.ts index e37bbf4..b8eedbe 100644 --- a/test/logical.spec.ts +++ b/test/logical.spec.ts @@ -2,7 +2,6 @@ import { And, Or } from '../lib/index.js'; import { exact } from './_support/asserts'; describe('Logical', function () { - test('And', () => { exact, true>(true); exact, true>(true); @@ -23,5 +22,4 @@ describe('Logical', function () { exact, false>(true); exact, false>(true); }); - }); diff --git a/test/mutable.spec.ts b/test/mutable.spec.ts index 822e74f..b87e163 100644 --- a/test/mutable.spec.ts +++ b/test/mutable.spec.ts @@ -1,72 +1,85 @@ -import { DeeperMutable, DeepMutable, Mutable, MutableSome } from '../lib/mutable.js'; +import { + DeeperMutable, + DeepMutable, + Mutable, + MutableSome, +} from '../lib/mutable.js'; import { exact } from './_support/asserts'; describe('Mutable', function () { - - test('MutableSome', () => { type I1 = { readonly a?: number; readonly b: string; readonly c: string; - } + }; - exact, { - a?: number; - b: string; - readonly c: string; - }>(true); + exact< + MutableSome, + { + a?: number; + b: string; + readonly c: string; + } + >(true); }); - test('Mutable', () => { - type unmodified = { readonly a?: number, readonly b: number }; + type unmodified = { readonly a?: number; readonly b: number }; type I1 = { readonly a?: number; readonly b: unmodified; - readonly c: unmodified[], + readonly c: unmodified[]; readonly n: never; readonly m?: never; - } - exact, { - a?: number; - b: unmodified; - c: unmodified[]; - }>(true); + }; + exact< + Mutable, + { + a?: number; + b: unmodified; + c: unmodified[]; + } + >(true); }); test('DeepMutable', () => { - type unmodified = { readonly a?: number, readonly b: number }; - type modified = { a?: number, b: number }; + type unmodified = { readonly a?: number; readonly b: number }; + type modified = { a?: number; b: number }; type I1 = { readonly a?: number; readonly b: unmodified; - readonly c: unmodified[], + readonly c: unmodified[]; readonly n: never; readonly m?: never; - } - exact, { - a?: number; - b: modified; - c: unmodified[]; - }>(true); + }; + exact< + DeepMutable, + { + a?: number; + b: modified; + c: unmodified[]; + } + >(true); }); test('DeeperMutable', () => { - type unmodified = { readonly a?: number, readonly b: number }; - type modified = { a?: number, b: number }; + type unmodified = { readonly a?: number; readonly b: number }; + type modified = { a?: number; b: number }; type I1 = { readonly a?: number; readonly b: unmodified; - readonly c: unmodified[], + readonly c: unmodified[]; readonly n: never; readonly m?: never; - } - exact, { - a?: number; - b: modified; - c: modified[]; - }>(true); + }; + exact< + DeeperMutable, + { + a?: number; + b: modified; + c: modified[]; + } + >(true); }); - }); diff --git a/test/nullish.spec.ts b/test/nullish.spec.ts index 83c5f26..8db6ccf 100644 --- a/test/nullish.spec.ts +++ b/test/nullish.spec.ts @@ -2,45 +2,46 @@ import { exact } from './_support/asserts'; import { DeepNullish, DeeperNullish, Type, NullishObject } from '../lib'; describe('DeepNullish', function () { - test('NullishObject', () => { - type unmodified = { a?: number, b: string }; + type unmodified = { a?: number; b: string }; type I1 = { - a1: boolean, - a2: unmodified, - a3?: unmodified[], - a4?: Map, - a5?: Type, + a1: boolean; + a2: unmodified; + a3?: unmodified[]; + a4?: Map; + a5?: Type; a6: number | undefined; readonly a7: number; n: never; m?: never; readonly c?: unmodified[]; - } + }; - exact, { - a1?: boolean | null, - a2?: unmodified | null, - a3?: unmodified[] | null, - a4?: Map | null, - a5?: Type | null, - a6?: number | null; - readonly a7?: number | null; - readonly c?: unmodified[] | null; - }>(true); + exact< + NullishObject, + { + a1?: boolean | null; + a2?: unmodified | null; + a3?: unmodified[] | null; + a4?: Map | null; + a5?: Type | null; + a6?: number | null; + readonly a7?: number | null; + readonly c?: unmodified[] | null; + } + >(true); }); - test('DeepNullish', () => { - type unmodified = { a?: number, b: string }; - type modified = { a?: number | null, b?: string | null }; + type unmodified = { a?: number; b: string }; + type modified = { a?: number | null; b?: string | null }; type I1 = { a?: { - a1: boolean, - a2: unmodified, - a3?: unmodified[], - a4?: Map, - a5?: Type, + a1: boolean; + a2: unmodified; + a3?: unmodified[]; + a4?: Map; + a5?: Type; a6: number | undefined; readonly a7: number; n: never; @@ -48,34 +49,37 @@ describe('DeepNullish', function () { }; b: string; readonly c?: unmodified[]; - n?: never - } + n?: never; + }; - exact, { - a?: { - a1?: boolean | null, - a2?: modified | null, - a3?: unmodified[] | null, - a4?: Map | null, - a5?: Type | null, - a6?: number | null; - readonly a7?: number | null; - } | null; - b?: string | null; - readonly c?: unmodified[] | null; - }>(true); + exact< + DeepNullish, + { + a?: { + a1?: boolean | null; + a2?: modified | null; + a3?: unmodified[] | null; + a4?: Map | null; + a5?: Type | null; + a6?: number | null; + readonly a7?: number | null; + } | null; + b?: string | null; + readonly c?: unmodified[] | null; + } + >(true); }); test('DeeperNullish', () => { - type unmodified = { a?: number, b: string }; - type modified = { a?: number | null, b?: string | null }; + type unmodified = { a?: number; b: string }; + type modified = { a?: number | null; b?: string | null }; type I1 = { a?: { - a1: boolean, - a2: unmodified, - a3?: unmodified[], - a4?: Map, - a5?: Type, + a1: boolean; + a2: unmodified; + a3?: unmodified[]; + a4?: Map; + a5?: Type; a6: number | undefined; readonly a7: number; n: never; @@ -83,23 +87,24 @@ describe('DeepNullish', function () { }; b: string; readonly c?: unmodified[]; - n?: never - } + n?: never; + }; - exact, { - a?: { - a1?: boolean | null, - a2?: modified | null, - a3?: modified[] | null, - a4?: Map | null, - a5?: Type | null, - a6?: number | null; - readonly a7?: number | null; - } | null; - b?: string | null; - readonly c?: modified[] | null; - }>(true); + exact< + DeeperNullish, + { + a?: { + a1?: boolean | null; + a2?: modified | null; + a3?: modified[] | null; + a4?: Map | null; + a5?: Type | null; + a6?: number | null; + readonly a7?: number | null; + } | null; + b?: string | null; + readonly c?: modified[] | null; + } + >(true); }); - - }); diff --git a/test/omit-never.spec.ts b/test/omit-never.spec.ts index 8c4dbc6..738f762 100644 --- a/test/omit-never.spec.ts +++ b/test/omit-never.spec.ts @@ -2,125 +2,131 @@ import { exact } from './_support/asserts'; import { DeepOmitNever, DeeperOmitNever, OmitNever } from '../lib'; describe('OmitNever', function () { - test('OmitNever', () => { type I1 = { a?: number; b: string; c: never; d?: never; - } - exact, { - a?: number; - b: string; - }>(true); + }; + exact< + OmitNever, + { + a?: number; + b: string; + } + >(true); }); test('DeepOmitNever', () => { type I1 = { a?: number; - b: string, - b1: never, - b2: never, + b: string; + b1: never; + b2: never; c: { - a?: string; - b: number, - b1: never, - b2: never, - }, - d?: { a?: string; b: number; - }, - e: { - a?: string; - b: number; - b1: never, - b2: never, - }[], - f?: { - a?: string; - b: number; - b1: never, - b2: never, - }[] - } - exact, { - a?: number; - b: string, - c: { - a?: string; - b: number - }, + b1: never; + b2: never; + }; d?: { a?: string; b: number; - }, + }; e: { a?: string; b: number; - b1: never, - b2: never, - }[], + b1: never; + b2: never; + }[]; f?: { a?: string; b: number; - b1: never, - b2: never, - }[] - }>(true); + b1: never; + b2: never; + }[]; + }; + exact< + DeepOmitNever, + { + a?: number; + b: string; + c: { + a?: string; + b: number; + }; + d?: { + a?: string; + b: number; + }; + e: { + a?: string; + b: number; + b1: never; + b2: never; + }[]; + f?: { + a?: string; + b: number; + b1: never; + b2: never; + }[]; + } + >(true); }); test('HighDeepOmitNever', () => { type I1 = { a?: number; - b: string, - b1: never, - b2: never, + b: string; + b1: never; + b2: never; c: { - a?: string; - b: number, - b1: never, - b2: never, - }, - d?: { - a?: string; - b: number; - }, - e: { - a?: string; - b: number; - b1: never, - b2: never, - }[], - f?: { a?: string; b: number; - b1: never, - b2: never, - }[] - } - exact, { - a?: number; - b: string, - c: { - a?: string; - b: number - }, + b1: never; + b2: never; + }; d?: { a?: string; b: number; - }, + }; e: { a?: string; b: number; - }[], + b1: never; + b2: never; + }[]; f?: { a?: string; b: number; - }[] - }>(true); + b1: never; + b2: never; + }[]; + }; + exact< + DeeperOmitNever, + { + a?: number; + b: string; + c: { + a?: string; + b: number; + }; + d?: { + a?: string; + b: number; + }; + e: { + a?: string; + b: number; + }[]; + f?: { + a?: string; + b: number; + }[]; + } + >(true); }); - - }); diff --git a/test/omit.spec.ts b/test/omit.spec.ts index dfba9f3..c25596a 100644 --- a/test/omit.spec.ts +++ b/test/omit.spec.ts @@ -1,22 +1,28 @@ import { exact } from './_support/asserts'; -import { DeeperOmitTypes, DeepOmitTypes, OmitFunctions, OmitTypes, StrictOmit } from '../lib'; +import { + DeeperOmitTypes, + DeepOmitTypes, + OmitFunctions, + OmitTypes, + StrictOmit, +} from '../lib'; describe('Omit', function () { - test('StrictOmit', () => { type I1 = { a?: number; b: string; - } - exact, { - a?: number - }>(true); + }; + exact< + StrictOmit, + { + a?: number; + } + >(true); }); - test('OmitFunctions', () => { - class TestClass { - } + class TestClass {} type I1 = { a1?: number; @@ -24,50 +30,59 @@ describe('Omit', function () { a3: () => boolean; a4: () => boolean; a5: TestClass; - n: never - m?: never - } - exact, { - a1?: number; - a2: string; - a5: TestClass; - }>(true); + n: never; + m?: never; + }; + exact< + OmitFunctions, + { + a1?: number; + a2: string; + a5: TestClass; + } + >(true); }); test('OmitTypes', () => { interface I1 { a: number; - b: undefined, - c: {}, - d: boolean, - f: never, - h: any, - i: unknown, - j: string | number | boolean, - k: () => void + b: undefined; + c: {}; + d: boolean; + f: never; + h: any; + i: unknown; + j: string | number | boolean; + k: () => void; } - exact, { - c: {}, - d: boolean, - h: any, - i: unknown, - j: string | boolean, - k: () => void - }>(true); - - exact, { - c: {}, - h: any, - i: unknown, - j: string, - k: () => void - }>(true); + exact< + OmitTypes, + { + c: {}; + d: boolean; + h: any; + i: unknown; + j: string | boolean; + k: () => void; + } + >(true); + + exact< + OmitTypes, + { + c: {}; + h: any; + i: unknown; + j: string; + k: () => void; + } + >(true); }); test('DeepOmitTypes', () => { - type unmodified = { a?: number, b: string, c: string | number | boolean }; - type modified = { b: string, c: string | boolean }; + type unmodified = { a?: number; b: string; c: string | number | boolean }; + type modified = { b: string; c: string | boolean }; interface I1 { a1: number; @@ -75,16 +90,18 @@ describe('Omit', function () { a3?: unmodified[]; } - exact, { - a2: modified; - a3?: unmodified[]; - }>(true); + exact< + DeepOmitTypes, + { + a2: modified; + a3?: unmodified[]; + } + >(true); }); - test('DeeperOmitTypes', () => { - type unmodified = { a?: number, b: string, c: string | number | boolean }; - type modified = { b: string, c: string | boolean }; + type unmodified = { a?: number; b: string; c: string | number | boolean }; + type modified = { b: string; c: string | boolean }; interface I1 { a1: number; @@ -92,10 +109,12 @@ describe('Omit', function () { a3?: unmodified[]; } - exact, { - a2: modified; - a3?: modified[]; - }>(true); + exact< + DeeperOmitTypes, + { + a2: modified; + a3?: modified[]; + } + >(true); }); - }); diff --git a/test/partial.spec.ts b/test/partial.spec.ts index 9f47261..f3c35f8 100644 --- a/test/partial.spec.ts +++ b/test/partial.spec.ts @@ -2,31 +2,33 @@ import { exact } from './_support/asserts'; import { DeepPartial, DeeperPartial, Type, PartialSome } from '../lib'; describe('DeepPartial', function () { - test('PartialSome', () => { type I1 = { a: number; readonly b: string; readonly c: string; - } + }; - exact, { - a?: number; - readonly b?: string; - readonly c: string; - }>(true); + exact< + PartialSome, + { + a?: number; + readonly b?: string; + readonly c: string; + } + >(true); }); test('DeepPartial', () => { - type unmodified = { a?: number, b: string }; - type modified = { a?: number, b?: string }; + type unmodified = { a?: number; b: string }; + type modified = { a?: number; b?: string }; type I1 = { a?: { - a1: boolean, - a2: unmodified, - a3?: unmodified[], - a4?: Map, - a5?: Type, + a1: boolean; + a2: unmodified; + a3?: unmodified[]; + a4?: Map; + a5?: Type; a6: number | undefined; readonly a7: number; n: never; @@ -34,34 +36,37 @@ describe('DeepPartial', function () { }; b: string; readonly c?: unmodified[]; - n?: never - } + n?: never; + }; - exact, { - a?: { - a1?: boolean, - a2?: modified, - a3?: unmodified[], - a4?: Map, - a5?: Type, - a6?: number; - readonly a7?: number; - }; - b?: string; - readonly c?: unmodified[]; - }>(true); + exact< + DeepPartial, + { + a?: { + a1?: boolean; + a2?: modified; + a3?: unmodified[]; + a4?: Map; + a5?: Type; + a6?: number; + readonly a7?: number; + }; + b?: string; + readonly c?: unmodified[]; + } + >(true); }); test('DeeperPartial', () => { - type unmodified = { a?: number, b: string }; - type modified = { a?: number, b?: string }; + type unmodified = { a?: number; b: string }; + type modified = { a?: number; b?: string }; type I1 = { a?: { - a1: boolean, - a2: unmodified, - a3?: unmodified[], - a4?: Map, - a5?: Type, + a1: boolean; + a2: unmodified; + a3?: unmodified[]; + a4?: Map; + a5?: Type; a6: number | undefined; readonly a7: number; n: never; @@ -69,22 +74,24 @@ describe('DeepPartial', function () { }; b: string; readonly c?: unmodified[]; - n?: never - } + n?: never; + }; - exact, { - a?: { - a1?: boolean, - a2?: modified, - a3?: modified[], - a4?: Map, - a5?: Type, - a6?: number; - readonly a7?: number; - }; - b?: string; - readonly c?: modified[]; - }>(true); + exact< + DeeperPartial, + { + a?: { + a1?: boolean; + a2?: modified; + a3?: modified[]; + a4?: Map; + a5?: Type; + a6?: number; + readonly a7?: number; + }; + b?: string; + readonly c?: modified[]; + } + >(true); }); - }); diff --git a/test/pick.spec.ts b/test/pick.spec.ts index 9e6f9f2..7e11ddc 100644 --- a/test/pick.spec.ts +++ b/test/pick.spec.ts @@ -2,92 +2,104 @@ import { exact } from './_support/asserts'; import { PickOptional, PickTypes, StrictPickTypes } from '../lib'; describe('Pick', function () { - test('PickOptional', () => { type I1 = { a?: number; - b: string, + b: string; c: { - a?: string; - b: number - }, - d?: { a?: string; b: number; - }, - e: { a?: string; b: number }[], - f?: { a?: string; b: number }[], - i: any; - j?: any; - } - exact, { - a?: number; + }; d?: { a?: string; b: number; - }, + }; + e: { a?: string; b: number }[]; f?: { a?: string; b: number }[]; + i: any; j?: any; - }>(true); + }; + exact< + PickOptional, + { + a?: number; + d?: { + a?: string; + b: number; + }; + f?: { a?: string; b: number }[]; + j?: any; + } + >(true); }); - test('PickTypes', () => { interface I1 { a: number; - b: undefined, - c: {}, - d: boolean, - e: null, - f: never, - h: any, - i: unknown, - j: string | number | boolean, - k: () => void + b: undefined; + c: {}; + d: boolean; + e: null; + f: never; + h: any; + i: unknown; + j: string | number | boolean; + k: () => void; } - exact, { - a: number; - c: {}, - h: any, - i: unknown, - j: string | number | boolean, - }>(true); + exact< + PickTypes, + { + a: number; + c: {}; + h: any; + i: unknown; + j: string | number | boolean; + } + >(true); - exact, { - c: {}, - d: boolean, - h: any, - i: unknown, - j: string | number | boolean, - }>(true); + exact< + PickTypes, + { + c: {}; + d: boolean; + h: any; + i: unknown; + j: string | number | boolean; + } + >(true); }); test('StrictPickTypes', () => { interface I1 { a: number; - b: undefined, - c: {}, - d: boolean, - e: null, - f: never, - h: any, - i: unknown, - j: string | number | boolean, - k: () => void, + b: undefined; + c: {}; + d: boolean; + e: null; + f: never; + h: any; + i: unknown; + j: string | number | boolean; + k: () => void; l: string; } - exact, { - a: number; - j: string | number | boolean, - }>(true); + exact< + StrictPickTypes, + { + a: number; + j: string | number | boolean; + } + >(true); - exact, { - d: boolean, - j: string | number | boolean, - l: string; - }>(true); + exact< + StrictPickTypes, + { + d: boolean; + j: string | number | boolean; + l: string; + } + >(true); }); - }); diff --git a/test/readonly.spec.ts b/test/readonly.spec.ts index 742e6eb..9f28837 100644 --- a/test/readonly.spec.ts +++ b/test/readonly.spec.ts @@ -1,59 +1,74 @@ import { exact } from './_support/asserts'; import { - DeepPickReadonly, DeepReadonly, DeeperPickReadonly, - DeeperReadonly, OmitReadonly, PickReadonly, ReadonlyKeys, - Type, DeepOmitReadonly, DeeperOmitReadonly, ReadonlySome + DeepPickReadonly, + DeepReadonly, + DeeperPickReadonly, + DeeperReadonly, + OmitReadonly, + PickReadonly, + ReadonlyKeys, + Type, + DeepOmitReadonly, + DeeperOmitReadonly, + ReadonlySome, } from '../lib'; describe('Readonly', function () { - test('ReadonlySome', () => { type I1 = { a?: number; b: string; c: string; - } + }; - exact, { - readonly a?: number; - readonly b: string; - c: string; - }>(true); + exact< + ReadonlySome, + { + readonly a?: number; + readonly b: string; + c: string; + } + >(true); }); test('DeepReadonly', () => { - type unmodified = { a?: number, b: number }; - type modified = { readonly a?: number, readonly b: number }; + type unmodified = { a?: number; b: number }; + type modified = { readonly a?: number; readonly b: number }; type I1 = { a?: number; b: unmodified; - c: unmodified[], + c: unmodified[]; n: never; m?: never; - } - exact, { - readonly a?: number; - readonly b: modified; - readonly c: unmodified[]; - }>(true); + }; + exact< + DeepReadonly, + { + readonly a?: number; + readonly b: modified; + readonly c: unmodified[]; + } + >(true); }); test('DeeperReadonly', () => { - type unmodified = { a?: number, b: number }; - type modified = { readonly a?: number, readonly b: number }; + type unmodified = { a?: number; b: number }; + type modified = { readonly a?: number; readonly b: number }; type I1 = { a?: number; b: unmodified; - c: unmodified[], + c: unmodified[]; n: never; m?: never; - } - exact, { - readonly a?: number; - readonly b: modified; - readonly c: modified[]; - }>(true); - + }; + exact< + DeeperReadonly, + { + readonly a?: number; + readonly b: modified; + readonly c: modified[]; + } + >(true); }); test('ReadonlyKeys', () => { @@ -68,7 +83,7 @@ describe('Readonly', function () { readonly b: string; readonly c: { a: string; - readonly b: number + readonly b: number; }; readonly d?: { readonly a?: string; @@ -80,22 +95,25 @@ describe('Readonly', function () { readonly h: () => void; i: any; readonly j?: any; - k: typeof sym - } - exact, { - readonly b: string; - readonly c: { - a: string; - readonly b: number - }; - readonly d?: { - readonly a?: string; - b: number; - }; - readonly f?: { readonly a?: string; b: number }[]; - readonly h: () => void; - readonly j?: any; - }>(true); + k: typeof sym; + }; + exact< + PickReadonly, + { + readonly b: string; + readonly c: { + a: string; + readonly b: number; + }; + readonly d?: { + readonly a?: string; + b: number; + }; + readonly f?: { readonly a?: string; b: number }[]; + readonly h: () => void; + readonly j?: any; + } + >(true); }); test('OmitReadonly', () => { @@ -116,78 +134,87 @@ describe('Readonly', function () { readonly h: () => void; i: any; readonly j?: any; - } - exact, { - a: number; - e: { a?: string; readonly b: number }[]; - g: () => void; - i: any; - }>(true); + }; + exact< + OmitReadonly, + { + a: number; + e: { a?: string; readonly b: number }[]; + g: () => void; + i: any; + } + >(true); }); test('DeepPickReadonly', () => { - type unmodified = { readonly a: number, b: string }; + type unmodified = { readonly a: number; b: string }; type modified = { readonly a: number }; type I1 = { readonly a: { - readonly a1: boolean, - readonly a2: unmodified, - readonly a3: unmodified[], - readonly a4: Map, - readonly a5: WeakMap, - readonly a6: Set, - readonly a7: WeakSet, - readonly a8: Type, - a9: number + readonly a1: boolean; + readonly a2: unmodified; + readonly a3: unmodified[]; + readonly a4: Map; + readonly a5: WeakMap; + readonly a6: Set; + readonly a7: WeakSet; + readonly a8: Type; + a9: number; }; b: string; - readonly c: { readonly a: string, b?: number }[]; + readonly c: { readonly a: string; b?: number }[]; readonly n: never; readonly m?: never; - } - exact, { - readonly a: { - readonly a1: boolean, - readonly a2: modified, - readonly a3: unmodified[], - readonly a4: Map, - readonly a5: WeakMap, - readonly a6: Set, - readonly a7: WeakSet, - readonly a8: Type, - }; - readonly c: { readonly a: string, b?: number }[] - }>(true); + }; + exact< + DeepPickReadonly, + { + readonly a: { + readonly a1: boolean; + readonly a2: modified; + readonly a3: unmodified[]; + readonly a4: Map; + readonly a5: WeakMap; + readonly a6: Set; + readonly a7: WeakSet; + readonly a8: Type; + }; + readonly c: { readonly a: string; b?: number }[]; + } + >(true); }); test('DeeperPickReadonly', () => { - type unmodified = { readonly a: number, b: string }; + type unmodified = { readonly a: number; b: string }; type modified = { readonly a: number }; type I1 = { readonly a: { - readonly a1: boolean, - readonly a2: unmodified, - readonly a3: Map, - readonly a4: Type, - a9: number + readonly a1: boolean; + readonly a2: unmodified; + readonly a3: Map; + readonly a4: Type; + a9: number; }; b: string; readonly c: { - readonly a: string, + readonly a: string; b?: number; readonly n: never; readonly m?: never; - }[] - } - exact, { - readonly a: { - readonly a1: boolean, - readonly a2: modified, - readonly a3: Map, - readonly a4: Type, - }; - readonly c: { readonly a: string }[] - }>(true); + }[]; + }; + exact< + DeeperPickReadonly, + { + readonly a: { + readonly a1: boolean; + readonly a2: modified; + readonly a3: Map; + readonly a4: Type; + }; + readonly c: { readonly a: string }[]; + } + >(true); }); test('DeepOmitReadonly', () => { @@ -207,12 +234,15 @@ describe('Readonly', function () { g: () => void; readonly h: () => void; n: never; - } - exact, { - a: number; - e: { a?: string; readonly b: number }[]; - g: () => void; - }>(true); + }; + exact< + DeepOmitReadonly, + { + a: number; + e: { a?: string; readonly b: number }[]; + g: () => void; + } + >(true); }); test('DeeperOmitReadonly', () => { @@ -232,13 +262,14 @@ describe('Readonly', function () { g: () => void; readonly h: () => void; n: never; - } - exact, { - a: number; - e: { a?: string }[]; - g: () => void; - }>(true); + }; + exact< + DeeperOmitReadonly, + { + a: number; + e: { a?: string }[]; + g: () => void; + } + >(true); }); - - }); diff --git a/test/required.spec.ts b/test/required.spec.ts index dc9cda6..b53720d 100644 --- a/test/required.spec.ts +++ b/test/required.spec.ts @@ -1,24 +1,33 @@ import { exact } from './_support/asserts'; import { - DeepRequired, DeeperRequired, PickRequired, - Type, DeepPickRequired, DeeperPickRequired, OmitRequired, - DeepOmitRequired, DeeperOmitRequired, RequiredSome + DeepRequired, + DeeperRequired, + PickRequired, + Type, + DeepPickRequired, + DeeperPickRequired, + OmitRequired, + DeepOmitRequired, + DeeperOmitRequired, + RequiredSome, } from '../lib'; describe('DeepRequired', function () { - test('RequiredSome', () => { type I1 = { a?: number; readonly b?: string; readonly c?: string; - } + }; - exact, { - a: number; - readonly b: string; - readonly c?: string; - }>(true); + exact< + RequiredSome, + { + a: number; + readonly b: string; + readonly c?: string; + } + >(true); }); test('DeepRequired', () => { @@ -26,136 +35,150 @@ describe('DeepRequired', function () { a?: number; b: { a?: string; - readonly b: number + readonly b: number; }; readonly c: { readonly a: string }[]; readonly n: never; readonly m?: never; - } - exact, { - a: number; - b: { - a: string; - readonly b: number - }; - readonly c: { readonly a: string }[] - }>(true); + }; + exact< + DeepRequired, + { + a: number; + b: { + a: string; + readonly b: number; + }; + readonly c: { readonly a: string }[]; + } + >(true); }); - test('DeeperRequired', () => { type I1 = { a?: number; b: { a?: string; - readonly b: number + readonly b: number; }; readonly c: { readonly a: string; readonly n: never; readonly m?: never; - }[] - } - exact, { - a: number; - b: { - a: string; - readonly b: number - }; - readonly c: { readonly a: string }[] - }>(true); + }[]; + }; + exact< + DeeperRequired, + { + a: number; + b: { + a: string; + readonly b: number; + }; + readonly c: { readonly a: string }[]; + } + >(true); }); test('PickRequired', () => { - type unmodified = { a: number, b?: string }; + type unmodified = { a: number; b?: string }; type I1 = { a?: number; - b: string, - c: unmodified, - d?: unmodified, - e: unmodified[], - f?: unmodified[] + b: string; + c: unmodified; + d?: unmodified; + e: unmodified[]; + f?: unmodified[]; i: any; j?: any; - } - exact, { - b: string, - c: unmodified, - e: unmodified[], - i: any; - }>(true); + }; + exact< + PickRequired, + { + b: string; + c: unmodified; + e: unmodified[]; + i: any; + } + >(true); }); test('OmitRequired', () => { - type unmodified = { a: number, b?: string }; + type unmodified = { a: number; b?: string }; type I1 = { a?: number; - b: string, - c: unmodified, - d?: unmodified, - e: unmodified[], - f?: unmodified[], + b: string; + c: unmodified; + d?: unmodified; + e: unmodified[]; + f?: unmodified[]; i: any; j?: any; - } - exact, { - a?: number; - d?: unmodified, - f?: unmodified[], - j?: any; - }>(true); + }; + exact< + OmitRequired, + { + a?: number; + d?: unmodified; + f?: unmodified[]; + j?: any; + } + >(true); }); test('DeepPickRequired', () => { - type unmodified = { a: number, b?: string }; + type unmodified = { a: number; b?: string }; type modified = { a: number }; type I1 = { a: { - a1: boolean, - a2: unmodified, - a3: unmodified[], - a4: Map, - a5: WeakMap, - a6: Set, - a7: WeakSet, - a8: Type, + a1: boolean; + a2: unmodified; + a3: unmodified[]; + a4: Map; + a5: WeakMap; + a6: Set; + a7: WeakSet; + a8: Type; a9?: number; n: never; m?: never; }; b?: string; - c: { a: string, b?: number }[]; + c: { a: string; b?: number }[]; n: never; m?: never; - } - exact, { - a: { - a1: boolean, - a2: modified, - a3: unmodified[], - a4: Map, - a5: WeakMap, - a6: Set, - a7: WeakSet, - a8: Type, - }; - c: { a: string, b?: number }[] - }>(true); + }; + exact< + DeepPickRequired, + { + a: { + a1: boolean; + a2: modified; + a3: unmodified[]; + a4: Map; + a5: WeakMap; + a6: Set; + a7: WeakSet; + a8: Type; + }; + c: { a: string; b?: number }[]; + } + >(true); }); test('DeepOmitRequired', () => { - type unmodified = { a: number, b?: string }; + type unmodified = { a: number; b?: string }; type modified = { b?: string }; type I1 = { a?: { - a1?: boolean, - a2?: unmodified, - a3?: unmodified[], - a4?: Map, - a5?: WeakMap, - a6?: Set, - a7?: WeakSet, - a8?: Type, + a1?: boolean; + a2?: unmodified; + a3?: unmodified[]; + a4?: Map; + a5?: WeakMap; + a6?: Set; + a7?: WeakSet; + a8?: Type; a9: number; n: never; m?: never; @@ -164,67 +187,73 @@ describe('DeepRequired', function () { c?: unmodified[]; n: never; m?: never; - } - exact, { - a?: { - a1?: boolean, - a2?: modified, - a3?: unmodified[], - a4?: Map, - a5?: WeakMap, - a6?: Set, - a7?: WeakSet, - a8?: Type, - }; - c?: unmodified[] - }>(true); + }; + exact< + DeepOmitRequired, + { + a?: { + a1?: boolean; + a2?: modified; + a3?: unmodified[]; + a4?: Map; + a5?: WeakMap; + a6?: Set; + a7?: WeakSet; + a8?: Type; + }; + c?: unmodified[]; + } + >(true); }); test('DeeperPickRequired', () => { - type unmodified = { a: number, b?: string }; + type unmodified = { a: number; b?: string }; type modified = { a: number }; type I1 = { a: { - a1: boolean, - a2: unmodified, - a4: Map, - a5: Type, + a1: boolean; + a2: unmodified; + a4: Map; + a5: Type; a6?: number; n: never; m?: never; }; b?: string; c: { - a: string, + a: string; b?: number; n: never; m?: never; - }[] - } - exact, { - a: { - a1: boolean, - a2: modified, - a4: Map, - a5: Type, - }; - c: { a: string }[] - }>(true); + }[]; + }; + exact< + DeeperPickRequired, + { + a: { + a1: boolean; + a2: modified; + a4: Map; + a5: Type; + }; + c: { a: string }[]; + } + >(true); }); test('DeeperOmitRequired', () => { - type unmodified = { a: number, b?: string }; + type unmodified = { a: number; b?: string }; type modified = { b?: string }; type I1 = { a?: { - a1?: boolean, - a2?: unmodified, - a3?: unmodified[], - a4?: Map, - a5?: WeakMap, - a6?: Set, - a7?: WeakSet, - a8?: Type, + a1?: boolean; + a2?: unmodified; + a3?: unmodified[]; + a4?: Map; + a5?: WeakMap; + a6?: Set; + a7?: WeakSet; + a8?: Type; a9: number; n: never; m?: never; @@ -233,21 +262,22 @@ describe('DeepRequired', function () { c?: unmodified[]; n: never; m?: never; - } - exact, { - a?: { - a1?: boolean, - a2?: modified, - a3?: modified[], - a4?: Map, - a5?: WeakMap, - a6?: Set, - a7?: WeakSet, - a8?: Type, - }; - c?: modified[] - }>(true); + }; + exact< + DeeperOmitRequired, + { + a?: { + a1?: boolean; + a2?: modified; + a3?: modified[]; + a4?: Map; + a5?: WeakMap; + a6?: Set; + a7?: WeakSet; + a8?: Type; + }; + c?: modified[]; + } + >(true); }); - - }); diff --git a/test/type-check.spec.ts b/test/type-check.spec.ts index acfa14d..8c4a4d5 100644 --- a/test/type-check.spec.ts +++ b/test/type-check.spec.ts @@ -1,376 +1,396 @@ -import {assert} from './_support/asserts'; +import { assert } from './_support/asserts'; import { - IfAny, - IfEmptyObject, - IfEquals, - IfNever, - IfObject, - IfTuple, - IfCompatible, - IfUndefined, - IfUnknown, - IfFunction, - IfClass, - IfNull, - IfNullish, - IfPrimitive, - IfTupleOrAny, - IfPrimitiveOrAny, - IfObjectOrAny, - IfFunctionOrAny, - IfClassOrAny, + IfAny, + IfEmptyObject, + IfEquals, + IfNever, + IfObject, + IfTuple, + IfCompatible, + IfUndefined, + IfUnknown, + IfFunction, + IfClass, + IfNull, + IfNullish, + IfPrimitive, + IfTupleOrAny, + IfPrimitiveOrAny, + IfObjectOrAny, + IfFunctionOrAny, + IfClassOrAny, } from '../lib'; interface NotEmptyObj { - x: 1; + x: 1; } -class ClassA { +class ClassA {} -} - -function FunctionA() { - -} +function FunctionA() {} type Indexed = Record; describe('Type checks', function () { - - test('IfNever', () => { - assert>(true); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - }); - - test('IfUndefined', () => { - assert>(true); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - }); - - test('IfUnknown', () => { - assert>(false); - assert>(false); - assert>(true); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - }); - - test('IfNull', () => { - assert>(false); - assert>(false); - assert>(true); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - }); - - test('IfNullish', () => { - assert>(false); - assert>(false); - assert>(true); - assert>(true); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - }); - - test('IfAny', () => { - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(true); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - }); - - test('IfTuple', () => { - assert>(true); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - }); - - test('IfTupleOrAny', () => { - assert>(true); - }); - - test('IfPrimitive', () => { - assert>(true); - assert>(true); - assert>(true); - assert>(true); - assert>(true); - assert>(true); - assert>(true); - assert>(true); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - }); - - test('IfPrimitiveOrAny', () => { - assert>(true); - }); - - test('IfObject', () => { - assert>(true); - assert>(true); - assert>(true); - assert>(true); - assert>(true); - assert>(true); - assert>(true); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(true); - assert>(true); - assert>(true); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - }); - - test('IfObjectOrAny', () => { - assert>(true); - }); - - test('IfEmptyObject', () => { - assert>(true); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert void>>(false); - }); - - test('IfFunction', () => { - assert void>>(true); - assert boolean>>(true); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - }); - - test('IfFunctionOrAny', () => { - assert>(true); - }); - - test('IfClass', () => { - assert>(true); - assert>(false); - assert void>>(false); - assert boolean>>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - }); - - test('IfClassOrAny', () => { - assert>(true); - }); - - test('IfCompatible', () => { - assert>(true); - assert>(false); - assert>(false); - assert>(false); - assert>(true); - assert>(true); - assert void, number>>(false); - - assert>(true); - assert>(true); - assert>(false); - assert>(false); - assert>(true); - assert>(true); - assert>(true); - - assert>(true); - assert>(true); - assert>(true); - assert>(true); - assert>(false); - assert>(false); - assert void, unknown>>(true); - - assert boolean, Function>>(true); - assert void, (...args: any) => any>>(true); - assert boolean, (...args: any) => number>>(false); - assert any, () => void>>(true); - assert any, (...args: any[]) => any>>(true); - assert void, (a: string) => void>>(false); - assert any, () => void>>(false); - assert void, (a: string) => void>>(true); - assert boolean, () => string>>(false); - assert boolean, () => any>>(true); - - assert void>>(true); - assert void>>(false); - assert void>>(false); - assert void>>(false); - assert void>>(true); - assert void>>(false); - assert number, (a: string) => void | string>>(false); - assert void | string, (a: string) => void>>(true); - - }); - - test('IfEquals', () => { - assert>(true); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - - assert>(true); - assert>(true); - assert>(true); - assert>(true); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - - assert>(true); - assert>(false); - assert>(false); - assert>(false); - - assert>(true); - assert>(true); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - - assert>(true); - assert>(true); - assert>(true); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - - assert>(true); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - - assert>(true); - assert, Indexed>>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert>(false); - assert, Indexed>>(false); - - assert>(false); - assert>(false); - assert>(false); - assert>(false); - - assert>(true); - assert>(true); - assert>(false); - - assert>(true); - assert>(true); - assert>(false); - - assert } }, { x: { y: Array<{ z: 1 }>; a?: number } }>>(false); - assert; a?: string } }, { x: { y: Array<{ z: 1 }>; a?: number } }>>(false); - assert } }, { x: { y: Array<{ z: 1 }> } }>>(true); - assert } }, { x: { y: Array<{ z?: 1 }> } }>>(false); - assert } }, { x: { y?: Array<{ z: 1 }> } }>>(false); - - assert void, (a: number, b: string) => number>>(false); - assert void, (a: number, b: string) => void>>(true); - assert any, (a: number, b: string) => number>>(false); - assert any, (a: number, b: string) => any>>(false); - assert any, (a: number, b: string) => any>>(false); - - assert>(true); - assert>(false); - assert>(false); - }); - - + test('IfNever', () => { + assert>(true); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + }); + + test('IfUndefined', () => { + assert>(true); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + }); + + test('IfUnknown', () => { + assert>(false); + assert>(false); + assert>(true); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + }); + + test('IfNull', () => { + assert>(false); + assert>(false); + assert>(true); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + }); + + test('IfNullish', () => { + assert>(false); + assert>(false); + assert>(true); + assert>(true); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + }); + + test('IfAny', () => { + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(true); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + }); + + test('IfTuple', () => { + assert>(true); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + }); + + test('IfTupleOrAny', () => { + assert>(true); + }); + + test('IfPrimitive', () => { + assert>(true); + assert>(true); + assert>(true); + assert>(true); + assert>(true); + assert>(true); + assert>(true); + assert>(true); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + }); + + test('IfPrimitiveOrAny', () => { + assert>(true); + }); + + test('IfObject', () => { + assert>(true); + assert>(true); + assert>(true); + assert>(true); + assert>(true); + assert>(true); + assert>(true); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(true); + assert>(true); + assert>(true); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + }); + + test('IfObjectOrAny', () => { + assert>(true); + }); + + test('IfEmptyObject', () => { + assert>(true); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert void>>(false); + }); + + test('IfFunction', () => { + assert void>>(true); + assert boolean>>(true); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + }); + + test('IfFunctionOrAny', () => { + assert>(true); + }); + + test('IfClass', () => { + assert>(true); + assert>(false); + assert void>>(false); + assert boolean>>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + }); + + test('IfClassOrAny', () => { + assert>(true); + }); + + test('IfCompatible', () => { + assert>(true); + assert>(false); + assert>(false); + assert>(false); + assert>(true); + assert>(true); + assert void, number>>(false); + + assert>(true); + assert>(true); + assert>(false); + assert>(false); + assert>(true); + assert>(true); + assert>(true); + + assert>(true); + assert>(true); + assert>(true); + assert>(true); + assert>(false); + assert>(false); + assert void, unknown>>(true); + + assert boolean, Function>>(true); + assert void, (...args: any) => any>>(true); + assert boolean, (...args: any) => number>>(false); + assert any, () => void>>(true); + assert any, (...args: any[]) => any>>(true); + assert void, (a: string) => void>>(false); + assert any, () => void>>(false); + assert void, (a: string) => void>>(true); + assert boolean, () => string>>(false); + assert boolean, () => any>>(true); + + assert void>>(true); + assert void>>(false); + assert void>>(false); + assert void>>(false); + assert void>>(true); + assert void>>(false); + assert number, (a: string) => void | string>>(false); + assert void | string, (a: string) => void>>( + true, + ); + }); + + test('IfEquals', () => { + assert>(true); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + + assert>(true); + assert>(true); + assert>(true); + assert>(true); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + + assert>(true); + assert>(false); + assert>(false); + assert>(false); + + assert>(true); + assert>(true); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + + assert>(true); + assert>(true); + assert>(true); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + + assert>(true); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + + assert>(true); + assert, Indexed>>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert>(false); + assert, Indexed>>(false); + + assert>(false); + assert>(false); + assert>(false); + assert>(false); + + assert>(true); + assert>(true); + assert>(false); + + assert>(true); + assert>(true); + assert>(false); + + assert< + IfEquals< + { x: { y: Array<{ z: 1 }> } }, + { x: { y: Array<{ z: 1 }>; a?: number } } + > + >(false); + assert< + IfEquals< + { x: { y: Array<{ z: 1 }>; a?: string } }, + { x: { y: Array<{ z: 1 }>; a?: number } } + > + >(false); + assert< + IfEquals<{ x: { y: Array<{ z: 1 }> } }, { x: { y: Array<{ z: 1 }> } }> + >(true); + assert< + IfEquals<{ x: { y: Array<{ z: 1 }> } }, { x: { y: Array<{ z?: 1 }> } }> + >(false); + assert< + IfEquals<{ x: { y: Array<{ z: 1 }> } }, { x: { y?: Array<{ z: 1 }> } }> + >(false); + + assert< + IfEquals<(a: number, b: string) => void, (a: number, b: string) => number> + >(false); + assert< + IfEquals<(a: number, b: string) => void, (a: number, b: string) => void> + >(true); + assert< + IfEquals<(a: number, b: string) => any, (a: number, b: string) => number> + >(false); + assert< + IfEquals<(a: number, b: number) => any, (a: number, b: string) => any> + >(false); + assert< + IfEquals<(a: number, b?: string) => any, (a: number, b: string) => any> + >(false); + + assert>(true); + assert>(false); + assert>(false); + }); }); diff --git a/tsconfig.json b/tsconfig.json index 697154d..aa454b5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,11 +7,6 @@ "noImplicitAny": true, "strictNullChecks": true }, - "include": [ - "src", - "test" - ], - "exclude": [ - "node_modules" - ] + "include": ["src", "test"], + "exclude": ["node_modules"] }