@stryke/fs 0.33.69 → 0.33.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog for Stryke - Fs
|
|
4
4
|
|
|
5
|
+
## [0.33.70](https://github.com/storm-software/stryke/releases/tag/fs%400.33.70) (05/01/2026)
|
|
6
|
+
|
|
7
|
+
### Updated Dependencies
|
|
8
|
+
|
|
9
|
+
- Updated **string-format** to **v0.17.13**
|
|
10
|
+
- Updated **type-checks** to **v0.6.5**
|
|
11
|
+
- Updated **convert** to **v0.7.3**
|
|
12
|
+
- Updated **helpers** to **v0.10.12**
|
|
13
|
+
- Updated **types** to **v0.12.0**
|
|
14
|
+
- Updated **json** to **v0.14.16**
|
|
15
|
+
- Updated **path** to **v0.28.2**
|
|
16
|
+
|
|
5
17
|
## [0.33.69](https://github.com/storm-software/stryke/releases/tag/fs%400.33.69) (04/26/2026)
|
|
6
18
|
|
|
7
19
|
### Updated Dependencies
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"to-array.mjs","names":[],"sources":["../../../../convert/src/to-array.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { Arrayable } from \"@stryke/types/array\";\nimport type { Nullable } from \"@stryke/types/
|
|
1
|
+
{"version":3,"file":"to-array.mjs","names":[],"sources":["../../../../convert/src/to-array.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { Arrayable } from \"@stryke/types/array\";\nimport type { Nullable } from \"@stryke/types/base\";\n\n/**\n * Convert `Arrayable<T>` to `Array<T>`\n *\n * @param array - The `Arrayable<T>` to convert\n * @returns An `Array<T>` containing the elements of the input\n */\nexport function toArray<T>(array?: Nullable<Arrayable<T>>): Array<T> {\n array = array ?? [];\n return Array.isArray(array) ? array : [array];\n}\n"],"mappings":";;;;;;;AA2BA,SAAgB,QAAW,OAA0C;AACnE,SAAQ,SAAS,EAAE;AACnB,QAAO,MAAM,QAAQ,MAAM,GAAG,QAAQ,CAAC,MAAM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.mjs","names":[],"sources":["../../../../types/src/base.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { TypedArray } from \"./array\";\n\nexport type SerializablePrimitive =\n | null\n | undefined\n | string\n | number\n | boolean\n | bigint;\nexport type Primitive = SerializablePrimitive | symbol;\n\n/**\n * Matches any primitive, `void`, `Date`, or `RegExp` value.\n */\nexport type BuiltIns = Primitive | void | Date | RegExp;\n\n/**\n * Matches any non-primitive object\n */\n// eslint-disable-next-line ts/no-unsafe-function-type\nexport type AtomicObject = Function | Promise<any> | Date | RegExp;\n\n/** Determines if the passed value is of a specific type */\nexport type TypeTester = (value: any) => boolean;\n\n/**\n * The interface for a type mapping (key =\\> function) to use for {@link getType}.\n * export * The key represents the name of the type. The function represents the {@link TypeTester | test method}.\n * The map should be ordered by testing preference, with more specific tests first.\n * If a test returns true, it is selected, and the key is returned as the type.\n */\nexport type TypeMap = Record<string, TypeTester>;\n\ndeclare const emptyObjectSymbol: unique symbol;\n\nexport type FunctionOrValue<Value> = Value extends () => infer X ? X : Value;\n\n/**\n * A [[List]]\n *\n * @example\n * ```ts\n * type list0 = [1, 2, 3]\n * type list1 = number[]\n * ```\n *\n * @param A - its type\n * @returns [[List]]\n */\nexport type List<A = any> = ReadonlyArray<A>;\n\n/**\n * Alias to create a [[Function]]\n *\n * @example\n * ```ts\n * import { FunctionLike } from '@stryke/types'\n *\n * type test0 = FunctionLike<[string, number], boolean>\n * /// (args_0: string, args_1: number) => boolean\n * ```\n *\n * @param P - parameters\n * @param R - return type\n * @returns [[Function]]\n */\nexport type FunctionLike<P extends List = any, R = any> = (...args: P) => R;\n\nexport type AnyFunction = FunctionLike<any, any>;\nexport type Nullish = undefined | null;\nexport type Nullishable<T> = T | Nullish;\nexport type NonNullishObject = object; // not null/undefined which are Object\nexport type NativeClass = abstract new (...args: any) => any;\nexport type AnyNumber = number | number;\nexport type AnyString = string | string;\nexport type AnyBoolean = boolean | boolean;\nexport type AnyArray = any[];\nexport type PlainObject = Record<any, object>; // https://stackoverflow.com/a/75052315/130638\nexport type AnyMap = Map<any, any>;\nexport type AnyWeakMap = WeakMap<WeakKey, any>;\nexport type EmptyArray = [];\nexport interface EmptyObject {\n [emptyObjectSymbol]?: never;\n}\n\nexport type Any =\n | boolean\n | number\n | bigint\n | string\n | null\n | undefined\n | void\n | symbol\n | object\n | PlainObject\n | AnyArray\n | AnyMap\n | AnyWeakMap;\n\n/**\n * The valid types of the index for an `Indexable` type object\n */\nexport type IndexType = string | number | symbol;\n\n/**\n * The declaration of a ***dictionary-type*** object with a specific type\n *\n * @see {@link Indexable}\n * @see {@link IndexType}\n * @see {@link Dictionary}\n */\nexport type TypedIndexable<T> = Record<IndexType, T>;\n\n/**\n * The declaration of a ***dictionary-type*** object\n *\n * @see {@link TypedIndexable}\n * @see {@link IndexType}\n * @see {@link Dictionary}\n */\nexport type Indexable = TypedIndexable<any>;\n\n/**\n * The declaration of a ***dictionary-type*** object with a specific type\n *\n * @see {@link Indexable}\n * @see {@link IndexType}\n * @see {@link TypedIndexable}\n */\nexport type Dictionary<T> = Record<string, T>;\n\nexport const EMPTY_STRING = \"\";\nexport const NEWLINE_STRING = \"\\r\\n\";\nexport const EMPTY_OBJECT = {};\n\nexport type AnyCase<T extends IndexType> = string extends T\n ? string\n : T extends `${infer F1}${infer F2}${infer R}`\n ? `${Uppercase<F1> | Lowercase<F1>}${Uppercase<F2> | Lowercase<F2>}${AnyCase<R>}`\n : T extends `${infer F}${infer R}`\n ? `${Uppercase<F> | Lowercase<F>}${AnyCase<R>}`\n : typeof EMPTY_STRING;\n\nexport type Newable<T> = new (..._args: never[]) => T;\n\nexport interface Abstract<T> {\n prototype: T;\n}\n\nexport interface Clonable<T> {\n clone: () => T;\n}\n\nexport type MaybePromise<T> = T | Promise<T>;\n\nexport type ReducerFunction<TState, TAction> = (\n state: TState,\n action: TAction\n) => TState;\n\n// NOTE: for the file size optimization\nexport const TYPE_ARGUMENTS = \"Arguments\";\nexport const TYPE_ARRAY = \"Array\";\nexport const TYPE_OBJECT = \"Object\";\nexport const TYPE_MAP = \"Map\";\nexport const TYPE_SET = \"Set\";\n\nexport type Collection =\n | IArguments\n | unknown[]\n | Map<unknown, unknown>\n | Record<string | number | symbol, unknown>\n | Set<unknown>;\n\nexport type NonUndefined<T> = T extends undefined ? never : T;\n\nexport type BrowserNativeObject = Date | File;\n\ntype Depth = [never, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];\n\nexport type DeepPartial<T, D extends number = 10> = D extends 0\n ? T\n : T extends BrowserNativeObject | NestedValue\n ? T\n : {\n [K in keyof T]?: T[K] extends object\n ? DeepPartial<T[K], Depth[D]>\n : T[K];\n };\n\nexport type Rollback = Record<\n string,\n (initialValue: any, currentValue: any) => any\n>;\n\n/**\n * Extract all required keys from the given type.\n *\n * @remarks\n * This is useful when you want to create a new type that contains different type values for the required keys only or use the list of keys for validation purposes, etc...\n */\nexport type RequiredKeysOf<BaseType extends object> = Exclude<\n {\n [Key in keyof BaseType]: BaseType extends Record<Key, BaseType[Key]>\n ? Key\n : never;\n }[keyof BaseType],\n undefined\n>;\n\n/**\n * Returns a boolean for whether the two given types are equal.\n *\n * @remarks\n * Use-cases: If you want to make a conditional branch based on the result of a comparison of two types.\n *\n * @see https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650\n * @see https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796\n */\nexport type IsEqual<A, B> =\n (<G>() => G extends A ? 1 : 2) extends <G>() => G extends B ? 1 : 2\n ? true\n : false;\n\nexport type Filter<KeyType, ExcludeType> =\n IsEqual<KeyType, ExcludeType> extends true\n ? never\n : KeyType extends ExcludeType\n ? never\n : KeyType;\n\ninterface ExceptOptions {\n /**\n Disallow assigning non-specified properties.\n\n Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.\n\n @defaultValue false\n */\n requireExactProps?: boolean;\n}\n\n/**\n * Create a type from an object type without certain keys.\n *\n * @remarks\n * We recommend setting the `requireExactProps` option to `true`.\n *\n * This type is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). The `Omit` type does not restrict the omitted keys to be keys present on the given type, while `Except` does. The benefits of a stricter type are avoiding typos and allowing the compiler to pick up on rename refactors automatically.\n *\n * This type was proposed to the TypeScript team, which declined it, saying they prefer that libraries implement stricter versions of the built-in types ([microsoft/TypeScript#30825](https://github.com/microsoft/TypeScript/issues/30825#issuecomment-523668235)).\n */\nexport type Except<\n ObjectType,\n KeysType extends keyof ObjectType,\n Options extends ExceptOptions = { requireExactProps: false }\n> = {\n [KeyType in keyof ObjectType as Filter<\n KeyType,\n KeysType\n >]: ObjectType[KeyType];\n} & (Options[\"requireExactProps\"] extends true\n ? Partial<Record<KeysType, never>>\n : Record<string, never>);\n\n/**\n * Useful to flatten the type output to improve type hints shown in editors. And also to transform an interface into a type to aide with assignability.\n *\n * @remarks\n * Sometimes it is desired to pass a value as a function argument that has a different type. At first inspection it may seem assignable, and then you discover it is not because the `value`'s type definition was defined as an interface. In the following example, `fn` requires an argument of type `Record<string, unknown>`. If the value is defined as a literal, then it is assignable. And if the `value` is defined as type using the `Simplify` utility the value is assignable. But if the `value` is defined as an interface, it is not assignable because the interface is not sealed and elsewhere a non-string property could be added to the interface.\n *\n * If the type definition must be an interface (perhaps it was defined in a third-party npm package), then the `value` can be defined as `const value: Simplify<SomeInterface> = ...`. Then `value` will be assignable to the `fn` argument. Or the `value` can be cast as `Simplify<SomeInterface>` if you can't re-declare the `value`.\n *\n * @see https://github.com/microsoft/TypeScript/issues/15300\n */\nexport type Simplify<T> = { [KeyType in keyof T]: T[KeyType] } & {};\n\n/**\n * Create a type that makes the given keys required. The remaining keys are kept as is.\n *\n * @remarks\n * Use-case: You want to define a single model where the only thing that changes is whether or not some of the keys are required.\n */\nexport type RequiredKeys<BaseType, Keys extends keyof BaseType> = Required<\n Pick<BaseType, Keys>\n> &\n Omit<BaseType, Keys>;\n\n/**\n * Create a type that makes the given keys optional. The remaining keys are kept as is.\n *\n * @remarks\n * Use-case: You want to define a single model where the only thing that changes is whether or not some of the keys are optional.\n */\nexport type PartialKeys<BaseType, Keys extends keyof BaseType> = Partial<\n Pick<BaseType, Keys>\n> &\n Omit<BaseType, Keys>;\n\nexport const $NestedValue: unique symbol = Symbol(\"NestedValue\");\n\nexport type NestedValue<TValue extends object = object> = {\n [$NestedValue]: never;\n} & TValue;\n\nexport interface RefObject<T> {\n current: T;\n}\n\nexport interface Identity<T = string> {\n id: T;\n}\n\nexport interface Versioned {\n version: number;\n}\n\nexport interface Sequenced {\n /**\n * The sequence number (version, or event counter, etc.) of the record\n */\n sequence: number;\n}\n\nexport interface Typed {\n /**\n * The type of the record\n */\n __type: string;\n}\n\nexport interface ClassTypeCheckable<T> extends Typed {\n /**\n * Run type check on the given value\n * @param value - The value to check\n * @returns True if the value is of the type of the class\n */\n isTypeOf: (value: unknown) => value is T;\n}\n\n/**\n * Matches non-recursive types.\n */\nexport type NonRecursiveType =\n | BuiltIns\n // eslint-disable-next-line ts/no-unsafe-function-type\n | Function\n | (new (...arguments_: any[]) => unknown);\n\nexport type IsPrimitive<T> = [T] extends [Primitive] ? true : false;\nexport type IsNever<T> = [T] extends [never] ? true : false;\nexport type IsAny<T> = 0 extends 1 & T ? true : false;\nexport type IsNull<T> = [T] extends [null] ? true : false;\nexport type IsUndefined<T> = T extends undefined ? true : false;\nexport type IsUnknown<T> = unknown extends T // `T` can be `unknown` or `any`\n ? IsNull<T> extends false // `any` can be `null`, but `unknown` can't be\n ? true\n : false\n : false;\nexport type IsNullish<T> = IsNull<T> & IsUndefined<T>;\nexport type IsFunction<T> = T extends AnyFunction ? true : false;\n\n/**\n * Declare locally scoped properties on `globalThis`.\n *\n * When defining a global variable in a declaration file is inappropriate, it can be helpful to define a `type` or `interface` (say `ExtraGlobals`) with the global variable and then cast `globalThis` via code like `globalThis as unknown as ExtraGlobals`.\n *\n * Instead of casting through `unknown`, you can update your `type` or `interface` to extend `GlobalThis` and then directly cast `globalThis`.\n *\n * @example\n * ```\n * import type { GlobalThis } from '@stryke/types';\n *\n * type ExtraGlobals = GlobalThis & {\n * readonly GLOBAL_TOKEN: string;\n * };\n *\n * (globalThis as ExtraGlobals).GLOBAL_TOKEN;\n * ```\n */\nexport type GlobalThis = typeof globalThis;\n\n/**\n * Matches a [`class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes).\n */\nexport interface Class<T, Arguments extends unknown[] = any[]> {\n prototype: Pick<T, keyof T>;\n new (...arguments_: Arguments): T;\n}\n\n/**\n * Matches a [`class` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes).\n */\nexport type Constructor<T, Arguments extends unknown[] = any[]> = new (\n ...arguments_: Arguments\n) => T;\n\n/**\n * Matches an [`abstract class`](https://www.typescriptlang.org/docs/handbook/classes.html#abstract-classes).\n *\n * @privateRemarks\n * We cannot use a `type` here because TypeScript throws: 'abstract' modifier cannot appear on a type member. (1070)\n */\n\nexport interface AbstractClass<\n T,\n Arguments extends unknown[] = any[]\n> extends AbstractConstructor<T, Arguments> {\n prototype: Pick<T, keyof T>;\n}\n\n/**\n * Matches an [`abstract class`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-2.html#abstract-construct-signatures) constructor.\n */\nexport type AbstractConstructor<\n T,\n Arguments extends unknown[] = any[]\n> = abstract new (...arguments_: Arguments) => T;\n\n/**\n * Create a tuple type of the given length `<L>` and fill it with the given type `<Fill>`.\n *\n * If `<Fill>` is not provided, it will default to `unknown`.\n *\n * @see https://itnext.io/implementing-arithmetic-within-typescripts-type-system-a1ef140a6f6f\n */\nexport type BuildTuple<\n L extends number,\n Fill = unknown,\n T extends readonly unknown[] = []\n> = T[\"length\"] extends L ? T : BuildTuple<L, Fill, [...T, Fill]>;\n\n/**\n * Test if the given function has multiple call signatures.\n *\n * Needed to handle the case of a single call signature with properties.\n *\n * Multiple call signatures cannot currently be supported due to a TypeScript limitation.\n * @see https://github.com/microsoft/TypeScript/issues/29732\n */\nexport type HasMultipleCallSignatures<\n T extends (...arguments_: any[]) => unknown\n> = T extends {\n (...arguments_: infer A): unknown;\n (...arguments_: infer B): unknown;\n}\n ? B extends A\n ? A extends B\n ? false\n : true\n : true\n : false;\n\ntype StructuredCloneablePrimitive =\n | string\n | number\n | bigint\n | boolean\n | null\n | undefined\n | boolean\n | number\n | string;\n\ntype StructuredCloneableData =\n | ArrayBuffer\n | DataView\n | Date\n | Error\n | RegExp\n | TypedArray\n | Blob\n | File;\n\n// DOM exclusive types\n// | AudioData\n// | CropTarget\n// | CryptoKey\n// | DOMException\n// | DOMMatrix\n// | DOMMatrixReadOnly\n// | DOMPoint\n// | DOMPointReadOnly\n// | DOMQuad\n// | DOMRect\n// | DOMRectReadOnly\n// | FileList\n// | FileSystemDirectoryHandle\n// | FileSystemFileHandle\n// | FileSystemHandle\n// | GPUCompilationInfo\n// | GPUCompilationMessage\n// | ImageBitmap\n// | ImageData\n// | RTCCertificate\n// | VideoFrame\n\ntype StructuredCloneableCollection =\n | readonly StructuredCloneable[]\n | {\n readonly [key: string]: StructuredCloneable;\n readonly [key: number]: StructuredCloneable;\n }\n | ReadonlyMap<StructuredCloneable, StructuredCloneable>\n | ReadonlySet<StructuredCloneable>;\n\n/**\n * Matches a value that can be losslessly cloned using `structuredClone`.\n *\n * Note:\n * - Custom error types will be cloned as the base `Error` type\n * - This type doesn't include types exclusive to the TypeScript DOM library (e.g. `DOMRect` and `VideoFrame`)\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm\n *\n * @example\n * ```\n * import type { StructuredCloneable } from '@stryke/types';\n *\n * class CustomClass {}\n *\n * // @ts-expect-error\n * const error: StructuredCloneable = {\n * custom: new CustomClass(),\n * };\n *\n * structuredClone(error);\n * //=> {custom: {}}\n *\n * const good: StructuredCloneable = {\n * number: 3,\n * date: new Date(),\n * map: new Map<string, number>(),\n * }\n *\n * good.map.set('key', 1);\n *\n * structuredClone(good);\n * //=> {number: 3, date: Date(2022-10-17 22:22:35.920), map: Map {'key' -> 1}}\n * ```\n */\nexport type StructuredCloneable =\n | StructuredCloneablePrimitive\n | StructuredCloneableData\n | StructuredCloneableCollection;\n"],"mappings":";AAsJA,MAAa,eAAe"}
|
|
1
|
+
{"version":3,"file":"base.mjs","names":[],"sources":["../../../../types/src/base.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { TypedArray } from \"./array\";\n\n/**\n * Matches any value that can be serialized to JSON.\n *\n * @remarks\n * This includes all primitive types except `symbol`, which cannot be serialized.\n */\nexport type SerializablePrimitive =\n | null\n | undefined\n | string\n | number\n | boolean\n | bigint;\n\n/**\n * Matches any primitive JavaScript value.\n *\n * @remarks\n * Includes `SerializablePrimitive` types plus `symbol`, which cannot be serialized to JSON.\n *\n * @example\n * ```ts\n * type test = Primitive;\n * // null | undefined | string | number | boolean | bigint | symbol\n * ```\n */\nexport type Primitive = SerializablePrimitive | symbol;\n\n/**\n * Matches any primitive, `void`, `Date`, or `RegExp` value.\n */\nexport type BuiltIns = Primitive | void | Date | RegExp;\n\n/**\n * Matches any non-primitive object\n */\n// eslint-disable-next-line ts/no-unsafe-function-type\nexport type AtomicObject = Function | Promise<any> | Date | RegExp;\n\n/** Determines if the passed value is of a specific type */\n/**\n * A function that tests whether a value matches a specific type.\n *\n * @param value - The value to test\n * @returns `true` if the value matches the type, `false` otherwise\n *\n * @example\n * ```ts\n * const isString: TypeTester = (value) => typeof value === 'string';\n * ```\n */\nexport type TypeTester = (value: any) => boolean;\n\n/**\n * The interface for a type mapping (key =\\> function) to use for {@link getType}.\n * export * The key represents the name of the type. The function represents the {@link TypeTester | test method}.\n * The map should be ordered by testing preference, with more specific tests first.\n * If a test returns true, it is selected, and the key is returned as the type.\n */\n/**\n * A mapping of type names to type testing functions.\n *\n * @remarks\n * The map should be ordered by testing preference, with more specific tests first. When a test returns `true`, it is selected and the corresponding key is returned as the type name.\n *\n * @see {@link TypeTester}\n * @see {@link getType}\n *\n * @example\n * ```ts\n * const typeMap: TypeMap = {\n * string: (v) => typeof v === 'string',\n * number: (v) => typeof v === 'number',\n * array: (v) => Array.isArray(v),\n * };\n * ```\n */\nexport type TypeMap = Record<string, TypeTester>;\n\ndeclare const emptyObjectSymbol: unique symbol;\n\nexport type FunctionOrValue<Value> = Value extends () => infer X ? X : Value;\n\n/**\n * A [[List]]\n *\n * @example\n * ```ts\n * type list0 = [1, 2, 3]\n * type list1 = number[]\n * ```\n *\n * @param A - its type\n * @returns [[List]]\n */\nexport type List<A = any> = ReadonlyArray<A>;\n\n/**\n * Alias to create a [[Function]]\n *\n * @example\n * ```ts\n * import { FunctionLike } from '@stryke/types'\n *\n * type test0 = FunctionLike<[string, number], boolean>\n * /// (args_0: string, args_1: number) => boolean\n * ```\n *\n * @param P - parameters\n * @param R - return type\n * @returns [[Function]]\n */\nexport type FunctionLike<P extends List = any, R = any> = (...args: P) => R;\n\nexport type AnyFunction = FunctionLike<any, any>;\nexport type Nullish = undefined | null;\nexport type Nullishable<T> = T | Nullish;\nexport type NonNullishObject = object; // not null/undefined which are Object\nexport type NativeClass = abstract new (...args: any) => any;\n/**\n * Matches any number type.\n */\nexport type AnyNumber = number | number;\n\n/**\n * Matches any string type.\n */\nexport type AnyString = string | string;\n\n/**\n * Matches any boolean type.\n */\nexport type AnyBoolean = boolean | boolean;\n/**\n * Matches an array of any type.\n */\nexport type AnyArray = any[];\n\n/**\n * Matches a plain object (POJO) with any key-value pairs.\n *\n * @see https://stackoverflow.com/a/75052315/130638\n */\nexport type PlainObject = Record<any, object>;\n\n/**\n * Matches a `Map` with any key and value types.\n */\nexport type AnyMap = Map<any, any>;\n\n/**\n * Matches a `WeakMap` with any key and value types.\n */\nexport type AnyWeakMap = WeakMap<WeakKey, any>;\n/**\n * Matches an empty array type.\n */\nexport type EmptyArray = [];\nexport interface EmptyObject {\n [emptyObjectSymbol]?: never;\n}\n\n/**\n * Matches any JavaScript value, including primitives and objects.\n */\nexport type Any =\n | boolean\n | number\n | bigint\n | string\n | null\n | undefined\n | void\n | symbol\n | object\n | PlainObject\n | AnyArray\n | AnyMap\n | AnyWeakMap;\n\n/**\n * The valid types of the index for an `Indexable` type object\n */\nexport type IndexType = string | number | symbol;\n\n/**\n * The declaration of a ***dictionary-type*** object with a specific type\n *\n * @see {@link Indexable}\n * @see {@link IndexType}\n * @see {@link Dictionary}\n */\nexport type TypedIndexable<T> = Record<IndexType, T>;\n\n/**\n * The declaration of a ***dictionary-type*** object\n *\n * @see {@link TypedIndexable}\n * @see {@link IndexType}\n * @see {@link Dictionary}\n */\nexport type Indexable = TypedIndexable<any>;\n\n/**\n * The declaration of a ***dictionary-type*** object with a specific type\n *\n * @see {@link Indexable}\n * @see {@link IndexType}\n * @see {@link TypedIndexable}\n */\nexport type Dictionary<T> = Record<string, T>;\n\nexport const EMPTY_STRING = \"\";\nexport const NEWLINE_STRING = \"\\r\\n\";\nexport const EMPTY_OBJECT = {};\n\n/**\n * Matches a string type where each character can be either uppercase or lowercase.\n *\n * @remarks\n * This is useful for creating case-insensitive string literal unions.\n *\n * @example\n * ```ts\n * type CaseInsensitive = AnyCase<'hello'>;\n * // 'hello' | 'Hello' | 'hEllo' | 'HEllo' | ...\n * ```\n */\nexport type AnyCase<T extends IndexType> = string extends T\n ? string\n : T extends `${infer F1}${infer F2}${infer R}`\n ? `${Uppercase<F1> | Lowercase<F1>}${Uppercase<F2> | Lowercase<F2>}${AnyCase<R>}`\n : T extends `${infer F}${infer R}`\n ? `${Uppercase<F> | Lowercase<F>}${AnyCase<R>}`\n : typeof EMPTY_STRING;\n\n/**\n * Matches a constructor function that returns an instance of type `T`.\n *\n * @example\n * ```ts\n * class MyClass {}\n * type MyClassConstructor = Newable<MyClass>;\n * ```\n */\nexport type Newable<T> = new (..._args: never[]) => T;\n\n/**\n * Matches an abstract class with the given prototype.\n *\n * @example\n * ```ts\n * abstract class Base {}\n * type BaseAbstract = Abstract<Base>;\n * ```\n */\nexport interface Abstract<T> {\n prototype: T;\n}\n\n/**\n * Matches an object that has a `clone()` method returning a copy of itself.\n */\nexport interface Clonable<T> {\n clone: () => T;\n}\n\n/**\n * Matches a value that is either of type `T` or a promise that resolves to `T`.\n *\n * @example\n * ```ts\n * type Result = MaybePromise<string>;\n * // string | Promise<string>\n * ```\n */\nexport type MaybePromise<T> = T | Promise<T>;\n\n/**\n * Matches a reducer function that takes the current state and an action, returning the next state.\n *\n * @remarks\n * This is the function signature used in state management libraries like Redux.\n *\n * @example\n * ```ts\n * type CounterReducer = ReducerFunction<number, { type: 'increment' | 'decrement' }>;\n * const reducer: CounterReducer = (state, action) => {\n * return action.type === 'increment' ? state + 1 : state - 1;\n * };\n * ```\n */\nexport type ReducerFunction<TState, TAction> = (\n state: TState,\n action: TAction\n) => TState;\n\n// NOTE: for the file size optimization\nexport const TYPE_ARGUMENTS = \"Arguments\";\nexport const TYPE_ARRAY = \"Array\";\nexport const TYPE_OBJECT = \"Object\";\nexport const TYPE_MAP = \"Map\";\nexport const TYPE_SET = \"Set\";\n\n/**\n * Matches any collection type including arrays, maps, sets, and plain objects.\n */\nexport type Collection =\n | IArguments\n | unknown[]\n | Map<unknown, unknown>\n | Record<string | number | symbol, unknown>\n | Set<unknown>;\n\n/**\n * Removes `undefined` from a union type.\n *\n * @example\n * ```ts\n * type test = NonUndefined<string | undefined>;\n * // string\n * ```\n */\nexport type NonUndefined<T> = T extends undefined ? never : T;\n\nexport type Nullable<T> = T | null;\nexport type IsNullable<T> = [null] extends [T] ? true : false;\n\nexport type RequiredByKey<T, K extends keyof T> = Omit<T, K> &\n Required<Pick<T, K>>;\n\nexport type NoInfer<T> = [T][T extends any ? 0 : never];\n\ntype Narrowable = string | number | bigint | boolean;\n\ntype NarrowRaw<A> =\n | (A extends [] ? [] : never)\n | (A extends Narrowable ? A : never)\n | {\n // eslint-disable-next-line ts/no-unsafe-function-type\n [K in keyof A]: A[K] extends Function ? A[K] : NarrowRaw<A[K]>;\n };\n\nexport type Narrow<A> = Try<A, [], NarrowRaw<A>>;\n\nexport type Try<A1, A2, Catch = never> = A1 extends A2 ? A1 : Catch;\n\n// Hack to get TypeScript to show simplified types in error messages\nexport type Pretty<T> = { [K in keyof T]: T[K] } & {};\n\nexport type ComputeRange<\n N extends number,\n Result extends unknown[] = []\n> = Result[\"length\"] extends N\n ? Result\n : ComputeRange<N, [...Result, Result[\"length\"]]>;\n\nexport type Index40 = ComputeRange<40>[number];\n\n/**\n * A utility type for specifying a name/value pair.\n */\nexport interface NameValuePair<TValue, TName = string> {\n /**\n * The name of the pair\n */\n name: TName;\n\n /**\n * The value of the pair\n */\n value: TValue;\n}\n\n/**\n * Ask TS to re-check that `A1` extends `A2`.\n * And if it fails, `A2` will be enforced anyway.\n * Can also be used to add constraints on parameters.\n *\n * @example\n * ```ts\n * import { Cast } from '@stryke/types'\n *\n * type test0 = Cast<'42', string> // '42'\n * type test1 = Cast<'42', number> // number\n * ```\n *\n * @param A1 - to check against\n * @param A2 - to cast to\n * @returns `A1 | A2`\n */\nexport type Cast<A1, A2> = A1 extends A2 ? A1 : A2;\n\n/**\n * Matches browser native object types that should not be recursively transformed.\n */\nexport type BrowserNativeObject = Date | File;\n\ntype Depth = [never, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];\n\n/**\n * Recursively makes all properties of an object type optional, except for properties that are of a primitive type or a browser native object type. The `D` parameter is used to limit the depth of the recursion to prevent infinite recursion in case of circular references. By default, the depth is set to 10, which should be sufficient for most use cases.\n *\n * @remarks\n * - This type is useful when you want to create a new type that has the same structure as an existing type, but with all properties being optional. For example, when you want to create a type for a partial update of an object.\n * - The properties that are of a primitive type or a browser native object type are not made optional because they are already immutable and do not have nested properties that can be made optional.\n */\nexport type DeepPartial<T, D extends number = 10> = D extends 0\n ? T\n : T extends BrowserNativeObject | NestedValue\n ? T\n : {\n [K in keyof T]?: T[K] extends object\n ? DeepPartial<T[K], Depth[D]>\n : T[K];\n };\n\n/**\n * Recursively makes all properties of an object type required.\n *\n * @remarks\n * - Properties that are primitives or browser native objects are left as-is.\n * - The `D` parameter controls recursion depth (default: 10) to prevent infinite recursion with circular references.\n * - More strict than `Required<T>` as it recursively applies to nested objects.\n *\n * @example\n * ```ts\n * type User = { name?: string; address?: { street?: string } };\n * type RequiredUser = DeepRequired<User>;\n * // { name: string; address: { street: string } }\n * ```\n */\nexport type DeepRequired<T, D extends number = 10> = D extends 0\n ? T\n : T extends BrowserNativeObject | NestedValue\n ? T\n : {\n [K in keyof T]-?: T[K] extends object\n ? DeepRequired<T[K], Depth[D]>\n : T[K];\n };\n\n/**\n * Recursively removes `null` and `undefined` from all properties of an object type.\n *\n * @remarks\n * - Properties that are primitives or browser native objects have their null/undefined removed.\n * - The `D` parameter controls recursion depth (default: 10) to prevent infinite recursion with circular references.\n * - More strict than `NonNullable<T>` as it recursively applies to nested objects.\n *\n * @example\n * ```ts\n * type User = { name: string | null; address: { street: string | null } | null };\n * type NonNullableUser = DeepNonNullable<User>;\n * // { name: string; address: { street: string } }\n * ```\n */\nexport type DeepNonNullable<T, D extends number = 10> = D extends 0\n ? T\n : T extends BrowserNativeObject | NestedValue\n ? T\n : {\n [K in keyof T]: T[K] extends object\n ? DeepNonNullable<T[K], Depth[D]>\n : NonNullable<T[K]>;\n };\n\n/**\n * Recursively makes all properties of an object type readonly.\n *\n * @remarks\n * - Properties that are primitives or browser native objects are marked readonly.\n * - The `D` parameter controls recursion depth (default: 10) to prevent infinite recursion with circular references.\n * - More strict than `Readonly<T>` as it recursively applies to nested objects.\n *\n * @example\n * ```ts\n * type User = { name: string; address: { street: string } };\n * type ReadonlyUser = DeepReadonly<User>;\n * // { readonly name: string; readonly address: { readonly street: string } }\n * ```\n */\nexport type DeepReadonly<T, D extends number = 10> = D extends 0\n ? T\n : T extends BrowserNativeObject | NestedValue\n ? T\n : {\n readonly [K in keyof T]: T[K] extends object\n ? DeepReadonly<T[K], Depth[D]>\n : T[K] extends Array<infer U>\n ? ReadonlyArray<DeepReadonly<U, Depth[D]>>\n : T[K];\n };\n\n/**\n * Recursively makes all properties of an object type readonly and removes `null`/`undefined`.\n *\n * @remarks\n * - Combines the effects of `DeepReadonly` and `DeepNonNullable`.\n * - The `D` parameter controls recursion depth (default: 10) to prevent infinite recursion with circular references.\n *\n * @example\n * ```ts\n * type User = { name?: string | null; address?: { street?: string | null } };\n * type ReadonlyUser = DeepReadonlyNonNullable<User>;\n * // { readonly name: string; readonly address: { readonly street: string } }\n * ```\n */\nexport type DeepReadonlyNonNullable<T, D extends number = 10> = D extends 0\n ? T\n : T extends BrowserNativeObject | NestedValue\n ? T\n : {\n readonly [K in keyof T]: T[K] extends object\n ? DeepReadonlyNonNullable<T[K], Depth[D]>\n : NonNullable<T[K]>;\n };\n\n/**\n * Recursively makes all properties of an object type readonly and explicitly nullable.\n *\n * @remarks\n * - Similar to `DeepReadonly`, but ensures all leaf properties are `| null`.\n * - The `D` parameter controls recursion depth (default: 10) to prevent infinite recursion with circular references.\n *\n * @example\n * ```ts\n * type User = { name: string; address: { street: string } };\n * type ReadonlyUser = DeepReadonlyNullable<User>;\n * // { readonly name: string | null; readonly address: { readonly street: string | null } }\n * ```\n */\nexport type DeepReadonlyNullable<T, D extends number = 10> = D extends 0\n ? T\n : T extends BrowserNativeObject | NestedValue\n ? T\n : {\n readonly [K in keyof T]: T[K] extends object\n ? DeepReadonlyNullable<T[K], Depth[D]>\n : T[K] | null;\n };\n\n/**\n * A mapping of property names to rollback functions.\n *\n * @remarks\n * Each rollback function takes the initial value and current value, and returns the value to rollback to.\n *\n * @example\n * ```ts\n * const rollbacks: Rollback = {\n * count: (initial, current) => initial,\n * timestamp: (initial, current) => Date.now(),\n * };\n * ```\n */\nexport type Rollback = Record<\n string,\n (initialValue: any, currentValue: any) => any\n>;\n\n/**\n * Extract all required keys from the given type.\n *\n * @remarks\n * This is useful when you want to create a new type that contains different type values for the required keys only or use the list of keys for validation purposes, etc...\n */\nexport type RequiredKeysOf<BaseType extends object> = Exclude<\n {\n [Key in keyof BaseType]: BaseType extends Record<Key, BaseType[Key]>\n ? Key\n : never;\n }[keyof BaseType],\n undefined\n>;\n\n/**\n * Returns a boolean for whether the two given types are equal.\n *\n * @remarks\n * Use-cases: If you want to make a conditional branch based on the result of a comparison of two types.\n *\n * @see https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650\n * @see https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796\n */\nexport type IsEqual<A, B> =\n (<G>() => G extends A ? 1 : 2) extends <G>() => G extends B ? 1 : 2\n ? true\n : false;\n\n/**\n * Filters out a specific type from a union.\n *\n * @remarks\n * Removes `ExcludeType` from `KeyType` if they are equal or if `KeyType` extends `ExcludeType`.\n *\n * @example\n * ```ts\n * type test = Filter<'a' | 'b' | 'c', 'b'>;\n * // 'a' | 'c'\n * ```\n */\nexport type Filter<KeyType, ExcludeType> =\n IsEqual<KeyType, ExcludeType> extends true\n ? never\n : KeyType extends ExcludeType\n ? never\n : KeyType;\n\ninterface ExceptOptions {\n /**\n Disallow assigning non-specified properties.\n\n Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.\n\n @defaultValue false\n */\n requireExactProps?: boolean;\n}\n\n/**\n * Create a type from an object type without certain keys.\n *\n * @remarks\n * We recommend setting the `requireExactProps` option to `true`.\n *\n * This type is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). The `Omit` type does not restrict the omitted keys to be keys present on the given type, while `Except` does. The benefits of a stricter type are avoiding typos and allowing the compiler to pick up on rename refactors automatically.\n *\n * This type was proposed to the TypeScript team, which declined it, saying they prefer that libraries implement stricter versions of the built-in types ([microsoft/TypeScript#30825](https://github.com/microsoft/TypeScript/issues/30825#issuecomment-523668235)).\n */\nexport type Except<\n ObjectType,\n KeysType extends keyof ObjectType,\n Options extends ExceptOptions = { requireExactProps: false }\n> = {\n [KeyType in keyof ObjectType as Filter<\n KeyType,\n KeysType\n >]: ObjectType[KeyType];\n} & (Options[\"requireExactProps\"] extends true\n ? Partial<Record<KeysType, never>>\n : Record<string, never>);\n\n/**\n * Useful to flatten the type output to improve type hints shown in editors. And also to transform an interface into a type to aide with assignability.\n *\n * @remarks\n * Sometimes it is desired to pass a value as a function argument that has a different type. At first inspection it may seem assignable, and then you discover it is not because the `value`'s type definition was defined as an interface. In the following example, `fn` requires an argument of type `Record<string, unknown>`. If the value is defined as a literal, then it is assignable. And if the `value` is defined as type using the `Simplify` utility the value is assignable. But if the `value` is defined as an interface, it is not assignable because the interface is not sealed and elsewhere a non-string property could be added to the interface.\n *\n * If the type definition must be an interface (perhaps it was defined in a third-party npm package), then the `value` can be defined as `const value: Simplify<SomeInterface> = ...`. Then `value` will be assignable to the `fn` argument. Or the `value` can be cast as `Simplify<SomeInterface>` if you can't re-declare the `value`.\n *\n * @see https://github.com/microsoft/TypeScript/issues/15300\n */\nexport type Simplify<T> = { [KeyType in keyof T]: T[KeyType] } & {};\n\n/**\n * Create a type that makes the given keys required. The remaining keys are kept as is.\n *\n * @remarks\n * Use-case: You want to define a single model where the only thing that changes is whether or not some of the keys are required.\n */\nexport type RequiredKeys<BaseType, Keys extends keyof BaseType> = Required<\n Pick<BaseType, Keys>\n> &\n Omit<BaseType, Keys>;\n\n/**\n * Create a type that makes the given keys optional. The remaining keys are kept as is.\n *\n * @remarks\n * Use-case: You want to define a single model where the only thing that changes is whether or not some of the keys are optional.\n */\nexport type PartialKeys<BaseType, Keys extends keyof BaseType> = Partial<\n Pick<BaseType, Keys>\n> &\n Omit<BaseType, Keys>;\n\nexport const $NestedValue: unique symbol = Symbol(\"NestedValue\");\n\n/**\n * Marks an object as a nested value that should not be recursively transformed.\n *\n * @remarks\n * Used internally by deep utility types to prevent recursion on certain values.\n *\n * @example\n * ```ts\n * type Special = NestedValue<{ custom: unknown }>;\n * ```\n */\nexport type NestedValue<TValue extends object = object> = {\n [$NestedValue]: never;\n} & TValue;\n\n/**\n * A mutable reference object that holds a current value.\n *\n * @remarks\n * Commonly used in React for holding mutable values that persist across renders.\n *\n * @example\n * ```ts\n * type InputRef = RefObject<HTMLInputElement>;\n * const inputRef: RefObject<HTMLInputElement> = { current: null };\n * ```\n */\nexport interface RefObject<T> {\n current: T;\n}\n\n/**\n * Matches an object that has an `id` property of type `T`.\n *\n * @remarks\n * By default, the `id` property is of type `string`.\n *\n * @example\n * ```ts\n * interface User extends Identity<number> {\n * name: string;\n * }\n * // { id: number; name: string }\n * ```\n */\nexport interface Identity<T = string> {\n id: T;\n}\n\n/**\n * Matches an object that has a `version` property.\n *\n * @remarks\n * Useful for tracking or managing different versions of data or entities.\n *\n * @example\n * ```ts\n * interface Document extends Versioned {\n * content: string;\n * }\n * // { version: number; content: string }\n * ```\n */\nexport interface Versioned {\n version: number;\n}\n\nexport interface Sequenced {\n /**\n * The sequence number (version, or event counter, etc.) of the record\n */\n sequence: number;\n}\n\n/**\n * Matches an object that declares its type via a `__type` property.\n *\n * @remarks\n * Useful for runtime type discrimination and serialization.\n *\n * @example\n * ```ts\n * interface Animal extends Typed {\n * name: string;\n * }\n * const dog: Animal = { __type: 'dog', name: 'Fido' };\n * ```\n */\nexport interface Typed {\n /**\n * The type of the record\n */\n __type: string;\n}\n\n/**\n * Matches a class or object that can perform type checking on values.\n *\n * @remarks\n * Extends `Typed` to include a type guard function for runtime type checking.\n *\n * @example\n * ```ts\n * class User implements ClassTypeCheckable<User> {\n * __type = 'user';\n * isTypeOf(value: unknown): value is User {\n * return value instanceof User;\n * }\n * }\n * ```\n */\nexport interface ClassTypeCheckable<T> extends Typed {\n /**\n * Run type check on the given value\n * @param value - The value to check\n * @returns True if the value is of the type of the class\n */\n isTypeOf: (value: unknown) => value is T;\n}\n\n/**\n * Matches non-recursive types.\n */\nexport type NonRecursiveType =\n | BuiltIns\n // eslint-disable-next-line ts/no-unsafe-function-type\n | Function\n | (new (...arguments_: any[]) => unknown);\n\n/**\n * Returns `true` if type `T` is a primitive type, `false` otherwise.\n *\n * @example\n * ```ts\n * type test1 = IsPrimitive<string>; // true\n * type test2 = IsPrimitive<object>; // false\n * ```\n */\nexport type IsPrimitive<T> = [T] extends [Primitive] ? true : false;\n\n/**\n * Returns `true` if type `T` is `never`, `false` otherwise.\n */\nexport type IsNever<T> = [T] extends [never] ? true : false;\n\n/**\n * Returns `true` if type `T` is `any`, `false` otherwise.\n */\nexport type IsAny<T> = 0 extends 1 & T ? true : false;\n\n/**\n * Returns `true` if type `T` is `null`, `false` otherwise.\n */\nexport type IsNull<T> = [T] extends [null] ? true : false;\n\n/**\n * Returns `true` if type `T` is `undefined`, `false` otherwise.\n */\nexport type IsUndefined<T> = T extends undefined ? true : false;\n\n/**\n * Returns `true` if type `T` is `unknown`, `false` otherwise.\n */\nexport type IsUnknown<T> = unknown extends T\n ? IsNull<T> extends false\n ? true\n : false\n : false;\n\n/**\n * Returns `true` if type `T` is `null | undefined`, `false` otherwise.\n */\nexport type IsNullish<T> = IsNull<T> & IsUndefined<T>;\n\n/**\n * Returns `true` if type `T` is a function type, `false` otherwise.\n */\nexport type IsFunction<T> = T extends AnyFunction ? true : false;\n\n/**\n * Declare locally scoped properties on `globalThis`.\n *\n * When defining a global variable in a declaration file is inappropriate, it can be helpful to define a `type` or `interface` (say `ExtraGlobals`) with the global variable and then cast `globalThis` via code like `globalThis as unknown as ExtraGlobals`.\n *\n * Instead of casting through `unknown`, you can update your `type` or `interface` to extend `GlobalThis` and then directly cast `globalThis`.\n *\n * @example\n * ```\n * import type { GlobalThis } from '@stryke/types';\n *\n * type ExtraGlobals = GlobalThis & {\n * readonly GLOBAL_TOKEN: string;\n * };\n *\n * (globalThis as ExtraGlobals).GLOBAL_TOKEN;\n * ```\n */\nexport type GlobalThis = typeof globalThis;\n\n/**\n * Matches a [`class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes).\n */\nexport interface Class<T, Arguments extends unknown[] = any[]> {\n prototype: Pick<T, keyof T>;\n new (...arguments_: Arguments): T;\n}\n\n/**\n * Matches a [`class` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes).\n */\nexport type Constructor<T, Arguments extends unknown[] = any[]> = new (\n ...arguments_: Arguments\n) => T;\n\n/**\n * Matches an [`abstract class`](https://www.typescriptlang.org/docs/handbook/classes.html#abstract-classes).\n *\n * @privateRemarks\n * We cannot use a `type` here because TypeScript throws: 'abstract' modifier cannot appear on a type member. (1070)\n */\n\nexport interface AbstractClass<\n T,\n Arguments extends unknown[] = any[]\n> extends AbstractConstructor<T, Arguments> {\n prototype: Pick<T, keyof T>;\n}\n\n/**\n * Matches an [`abstract class`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-2.html#abstract-construct-signatures) constructor.\n */\nexport type AbstractConstructor<\n T,\n Arguments extends unknown[] = any[]\n> = abstract new (...arguments_: Arguments) => T;\n\n/**\n * Create a tuple type of the given length `<L>` and fill it with the given type `<Fill>`.\n *\n * If `<Fill>` is not provided, it will default to `unknown`.\n *\n * @see https://itnext.io/implementing-arithmetic-within-typescripts-type-system-a1ef140a6f6f\n */\nexport type BuildTuple<\n L extends number,\n Fill = unknown,\n T extends readonly unknown[] = []\n> = T[\"length\"] extends L ? T : BuildTuple<L, Fill, [...T, Fill]>;\n\n/**\n * Test if the given function has multiple call signatures.\n *\n * Needed to handle the case of a single call signature with properties.\n *\n * Multiple call signatures cannot currently be supported due to a TypeScript limitation.\n * @see https://github.com/microsoft/TypeScript/issues/29732\n */\nexport type HasMultipleCallSignatures<\n T extends (...arguments_: any[]) => unknown\n> = T extends {\n (...arguments_: infer A): unknown;\n (...arguments_: infer B): unknown;\n}\n ? B extends A\n ? A extends B\n ? false\n : true\n : true\n : false;\n\ntype StructuredCloneablePrimitive =\n | string\n | number\n | bigint\n | boolean\n | null\n | undefined\n | boolean\n | number\n | string;\n\ntype StructuredCloneableData =\n | ArrayBuffer\n | DataView\n | Date\n | Error\n | RegExp\n | TypedArray\n | Blob\n | File;\n\n// DOM exclusive types\n// | AudioData\n// | CropTarget\n// | CryptoKey\n// | DOMException\n// | DOMMatrix\n// | DOMMatrixReadOnly\n// | DOMPoint\n// | DOMPointReadOnly\n// | DOMQuad\n// | DOMRect\n// | DOMRectReadOnly\n// | FileList\n// | FileSystemDirectoryHandle\n// | FileSystemFileHandle\n// | FileSystemHandle\n// | GPUCompilationInfo\n// | GPUCompilationMessage\n// | ImageBitmap\n// | ImageData\n// | RTCCertificate\n// | VideoFrame\n\ntype StructuredCloneableCollection =\n | readonly StructuredCloneable[]\n | {\n readonly [key: string]: StructuredCloneable;\n readonly [key: number]: StructuredCloneable;\n }\n | ReadonlyMap<StructuredCloneable, StructuredCloneable>\n | ReadonlySet<StructuredCloneable>;\n\n/**\n * Matches a value that can be losslessly cloned using `structuredClone`.\n *\n * Note:\n * - Custom error types will be cloned as the base `Error` type\n * - This type doesn't include types exclusive to the TypeScript DOM library (e.g. `DOMRect` and `VideoFrame`)\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm\n *\n * @example\n * ```\n * import type { StructuredCloneable } from '@stryke/types';\n *\n * class CustomClass {}\n *\n * // @ts-expect-error\n * const error: StructuredCloneable = {\n * custom: new CustomClass(),\n * };\n *\n * structuredClone(error);\n * //=> {custom: {}}\n *\n * const good: StructuredCloneable = {\n * number: 3,\n * date: new Date(),\n * map: new Map<string, number>(),\n * }\n *\n * good.map.set('key', 1);\n *\n * structuredClone(good);\n * //=> {number: 3, date: Date(2022-10-17 22:22:35.920), map: Map {'key' -> 1}}\n * ```\n */\nexport type StructuredCloneable =\n | StructuredCloneablePrimitive\n | StructuredCloneableData\n | StructuredCloneableCollection;\n"],"mappings":";AAwOA,MAAa,eAAe"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stryke/fs",
|
|
3
|
-
"version": "0.33.
|
|
3
|
+
"version": "0.33.70",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A package containing various file system utilities that expand the functionality of NodeJs's built-in `fs` module.",
|
|
6
6
|
"repository": {
|
|
@@ -105,11 +105,11 @@
|
|
|
105
105
|
"types": "./dist/index.d.cts",
|
|
106
106
|
"dependencies": {
|
|
107
107
|
"@antfu/install-pkg": "^1.1.0",
|
|
108
|
-
"@storm-software/config-tools": "^1.
|
|
109
|
-
"@stryke/convert": "^0.7.
|
|
110
|
-
"@stryke/helpers": "^0.10.
|
|
111
|
-
"@stryke/path": "^0.28.
|
|
112
|
-
"@stryke/string-format": "^0.17.
|
|
108
|
+
"@storm-software/config-tools": "^1.190.1",
|
|
109
|
+
"@stryke/convert": "^0.7.3",
|
|
110
|
+
"@stryke/helpers": "^0.10.12",
|
|
111
|
+
"@stryke/path": "^0.28.2",
|
|
112
|
+
"@stryke/string-format": "^0.17.13",
|
|
113
113
|
"chalk": "^5.6.2",
|
|
114
114
|
"defu": "^6.1.7",
|
|
115
115
|
"glob": "^11.1.0",
|
|
@@ -122,12 +122,12 @@
|
|
|
122
122
|
"devDependencies": {
|
|
123
123
|
"@types/node": "^24.12.2",
|
|
124
124
|
"@types/semver": "^7.7.1",
|
|
125
|
-
"nx": "22.7.
|
|
125
|
+
"nx": "22.7.1",
|
|
126
126
|
"tinyexec": "^0.3.2",
|
|
127
127
|
"tsdown": "^0.17.2"
|
|
128
128
|
},
|
|
129
|
-
"peerDependencies": { "nx": "22.7.
|
|
129
|
+
"peerDependencies": { "nx": "22.7.1" },
|
|
130
130
|
"peerDependenciesMeta": { "nx": { "optional": true } },
|
|
131
131
|
"publishConfig": { "access": "public" },
|
|
132
|
-
"gitHead": "
|
|
132
|
+
"gitHead": "1483b450abaad8ecaa28225e7af6d412b694edd9"
|
|
133
133
|
}
|