@sorrell/utilities 1.2.15 → 1.2.16

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.
Files changed (60) hide show
  1. package/Distribution/PackageExports.Generated.json +10 -0
  2. package/Distribution/Types/FileSystem/FileSystem.d.cts +2 -0
  3. package/Distribution/Types/FileSystem/FileSystem.d.cts.map +1 -1
  4. package/Distribution/Types/FileSystem/FileSystem.d.mts +2 -0
  5. package/Distribution/Types/FileSystem/FileSystem.d.mts.map +1 -1
  6. package/Distribution/Types/FileSystem/FileSystem.d.ts +2 -0
  7. package/Distribution/Types/FileSystem/FileSystem.d.ts.map +1 -1
  8. package/Distribution/Types/FileSystem/Module/Module.Internal.d.cts +7 -0
  9. package/Distribution/Types/FileSystem/Module/Module.Internal.d.cts.map +10 -0
  10. package/Distribution/Types/FileSystem/Module/Module.Internal.d.mts +7 -0
  11. package/Distribution/Types/FileSystem/Module/Module.Internal.d.mts.map +10 -0
  12. package/Distribution/Types/FileSystem/Module/Module.Internal.d.ts +7 -0
  13. package/Distribution/Types/FileSystem/Module/Module.Internal.d.ts.map +1 -0
  14. package/Distribution/Types/FileSystem/Module/Module.Types.d.cts +14 -0
  15. package/Distribution/Types/FileSystem/Module/Module.Types.d.cts.map +10 -0
  16. package/Distribution/Types/FileSystem/Module/Module.Types.d.mts +14 -0
  17. package/Distribution/Types/FileSystem/Module/Module.Types.d.mts.map +10 -0
  18. package/Distribution/Types/FileSystem/Module/Module.Types.d.ts +14 -0
  19. package/Distribution/Types/FileSystem/Module/Module.Types.d.ts.map +1 -0
  20. package/Distribution/Types/FileSystem/Module/Module.d.cts +15 -0
  21. package/Distribution/Types/FileSystem/Module/Module.d.cts.map +10 -0
  22. package/Distribution/Types/FileSystem/Module/Module.d.mts +15 -0
  23. package/Distribution/Types/FileSystem/Module/Module.d.mts.map +10 -0
  24. package/Distribution/Types/FileSystem/Module/Module.d.ts +15 -0
  25. package/Distribution/Types/FileSystem/Module/Module.d.ts.map +1 -0
  26. package/Distribution/Types/FileSystem/Module/index.d.cts +9 -0
  27. package/Distribution/Types/FileSystem/Module/index.d.cts.map +10 -0
  28. package/Distribution/Types/FileSystem/Module/index.d.mts +9 -0
  29. package/Distribution/Types/FileSystem/Module/index.d.mts.map +10 -0
  30. package/Distribution/Types/FileSystem/Module/index.d.ts +9 -0
  31. package/Distribution/Types/FileSystem/Module/index.d.ts.map +1 -0
  32. package/Distribution/Types/FileSystem/index.d.cts +1 -0
  33. package/Distribution/Types/FileSystem/index.d.cts.map +1 -1
  34. package/Distribution/Types/FileSystem/index.d.mts +1 -0
  35. package/Distribution/Types/FileSystem/index.d.mts.map +1 -1
  36. package/Distribution/Types/FileSystem/index.d.ts +1 -0
  37. package/Distribution/Types/FileSystem/index.d.ts.map +1 -1
  38. package/Distribution/Types/String/String.d.cts +1 -0
  39. package/Distribution/Types/String/String.d.cts.map +1 -1
  40. package/Distribution/Types/String/String.d.mts +1 -0
  41. package/Distribution/Types/String/String.d.mts.map +1 -1
  42. package/Distribution/Types/String/String.d.ts +1 -0
  43. package/Distribution/Types/String/String.d.ts.map +1 -1
  44. package/Distribution/fs-module.cjs +161 -0
  45. package/Distribution/fs-module.cjs.map +7 -0
  46. package/Distribution/fs-module.js +128 -0
  47. package/Distribution/fs-module.js.map +7 -0
  48. package/Distribution/fs.cjs +116 -2
  49. package/Distribution/fs.cjs.map +4 -4
  50. package/Distribution/fs.js +125 -5
  51. package/Distribution/fs.js.map +4 -4
  52. package/Distribution/index.cjs +144 -37
  53. package/Distribution/index.cjs.map +4 -4
  54. package/Distribution/index.js +147 -40
  55. package/Distribution/index.js.map +4 -4
  56. package/Distribution/string.cjs +4 -0
  57. package/Distribution/string.cjs.map +2 -2
  58. package/Distribution/string.js +4 -0
  59. package/Distribution/string.js.map +2 -2
  60. package/package.json +11 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../Source/index.ts", "../Source/Array/index.ts", "../Source/Array/Array.ts", "../Source/Async/index.ts", "../Source/Miscellaneous/Utility.Types.ts", "../Source/Async/Async.ts", "../Source/Math/Complex.ts", "../Source/Math/Complex.Internal.ts", "../Source/FileSystem/index.ts", "../Source/FileSystem/FileSystem.ts", "../Source/Functional/index.ts", "../Source/Functional/Functional.ts", "../Source/Math/index.ts", "../Source/Math/Index.Complex.ts", "../Source/Math/Vector.ts", "../Source/Math/Math.ts", "../Source/Miscellaneous/index.ts", "../Source/Npm/index.ts", "../Source/Npm/Npm.ts", "../Source/Npm/Npm.Error.ts", "../Source/Path/index.ts", "../Source/Path/Path.ts", "../Source/Record/index.ts", "../Source/Record/Record.ts", "../Source/String/index.ts", "../Source/String/String.ts", "../Source/TsConfig/index.ts", "../Source/Tuple/index.ts", "../Source/Type/index.ts"],
4
- "sourcesContent": ["/**\n * @file index.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\n/**\n * @module\n * General-purpose utility types and functions.\n * This module barrel-exports each scoped export of this package.\n * Use the scoped exports of this package to access only specific\n * utilities (*e.g.*, `async`, `npm`, *etc.*).\n */\nexport * as Array from \"./Array/index.ts\";\nexport * as Async from \"./Async/index.ts\";\nexport * as Complex from \"./Math/Complex.ts\";\nexport * as FileSystem from \"./FileSystem/index.ts\";\nexport * as Functional from \"./Functional/index.ts\";\nexport * as Math from \"./Math/index.ts\";\nexport * as Miscellaneous from \"./Miscellaneous/index.ts\";\nexport * as Npm from \"./Npm/index.ts\";\nexport * as Path from \"./Path/index.ts\";\nexport * as Record from \"./Record/index.ts\";\nexport * as String from \"./String/index.ts\";\nexport * as TsConfig from \"./TsConfig/index.ts\";\nexport * as Tuple from \"./Tuple/index.ts\";\nexport * as Type from \"./Type/index.ts\";\n", "/**\n * @file index.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nexport * from \"./Array.ts\";\nexport * from \"./Array.Types.ts\";\n", "/**\n * @file Array.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nimport type { FilteredArray, Options, TArrayType } from \"./Array.Types.ts\";\nimport type { NoOptions } from \"../Option/Option.Types.ts\";\n/**\n * Filter out all instances of `undefined` from a given {@link Array:param}.\n * @param Array - The array to filter.\n *\n * @template ElementType - The type of the elements in the array.\n *\n * @returns {TArrayType<Exclude<ElementType, undefined>, Exclude<OptionsType, Options.MaybeDefined>>}\n * A new `Array` of type `Exclude<ElementType, undefined>` and `OptionsType` that is the given\n * {@link OptionsType}, with the {@link Options.MaybeDefined} option removed.\n *\n * @example With the given {@link ElementType} including `undefined`.\n * ```typescript\n * const MaybeOddNumbers: TArray<number | undefined> = [ 1, 3, undefined, 5 ];\n * const OddNumbers: TArray<number> = FilterDefined(MaybeOddNumbers);\n * ```\n * @example With the given {@link OptionsType} including `Options.MaybeDefined`.\n * ```typescript\n * const MaybeOddNumbers: TArray<number, Options.MaybeDefined> = [ 1, 3, undefined, 5 ];\n * const OddNumbers: TArray<number> = FilterDefined(MaybeOddNumbers);\n * ```\n */\nexport function FilterDefined<ElementType, OptionsType extends Options = NoOptions, ArraySize extends number = number>(Array: TArrayType<ElementType, OptionsType | Options.MaybeDefined, ArraySize>): FilteredArray<ElementType>;\nexport function FilterDefined<ElementType, OptionsType extends Options = NoOptions, ArraySize extends number = number>(Array: TArrayType<ElementType | undefined, OptionsType, ArraySize>): FilteredArray<ElementType>;\nexport function FilterDefined<ElementType, OptionsType extends Options = NoOptions, ArraySize extends number = number>(Array: TArrayType<ElementType | undefined, OptionsType | Options.MaybeDefined, ArraySize>): FilteredArray<ElementType>;\nexport function FilterDefined<ElementType, OptionsType extends Options = NoOptions, ArraySize extends number = number>(Array: TArrayType<ElementType | undefined, OptionsType | Options.MaybeDefined, ArraySize>): FilteredArray<ElementType> {\n return Array.filter((Element: ElementType | undefined): boolean => {\n return Element !== undefined;\n }) as FilteredArray<ElementType>;\n}\n", "/**\n * @file index.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nexport * from \"./Async.ts\";\nexport * from \"./Async.Types.ts\";\n", "/**\n * @file Utility.Types.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\n/**\n * A simple wrapper to allow passing primitives to functions by-reference.\n *\n * @template Type - The type of the value wrapped by this.\n */\nexport type Ref<Type> = {\n Ref: Type | undefined;\n};\n/**\n * The opposite of {@link NonNullable}: the union of a given {@link Type}, `null`, and `undefined`.\n *\n * @template Type - The nontrivial type in this union.\n */\nexport type TNullable<Type> = Type | null | undefined;\n/** An error that is thrown in default implementations of `abstract` `class`es. */\nexport class AbstractMethodCallError extends Error {\n public constructor(ClassName?: string) {\n super(ClassName);\n }\n}\n/**\n * A \"safe\" intersection of two types, such that if exactly one\n * of the two types is `never`, then this evaluates to the other type.\n * This evaluates to the intersection of the two types iff *both*\n * type parameters.\n *\n * @template LeftType - The first type parameter.\n * @template RightType - The second type parameter.\n */\nexport type TSafeIntersection<LeftType, RightType> = [\n LeftType\n] extends [\n never\n] ? [\n RightType\n] extends [\n never\n] ? never : RightType : [\n RightType\n] extends [\n never\n] ? LeftType : (LeftType & RightType);\n", "/**\n * @file Async.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nimport { AbstractMethodCallError, type TNullable } from \"../Miscellaneous/Utility.Types.ts\";\nimport type { TOnFulfilled, TOnRejected, TPromiseCtorArgument, TTryResult, TTrySource } from \"./Async.Types.ts\";\nimport type { TFunction } from \"../Functional/Functional.Types.ts\";\n/**\n * Implements \"Errors-as-values\" for `async` functions and `Promise<DataType>`s.\n *\n * If the `async` function or `Promise<DataType>` returns/resolves, then the `Error`\n * property of the returned object will be `undefined`, and the result of the\n * `async` function or `Promise<DataType>` will reside in the `Data` property of the\n * returned object.\n *\n * Similarly, if the `async` function or `Promise<DataType>` throws, then the `Data`\n * property of the returned object is `undefined`, and the `Error` property is what\n * was thrown to the `catch` block.\n *\n * @template DataType - The type of the data that the `async` function or `Promise<DataType>`.\n * @param Source - The `async` function or `Promise` to evaluate.\n *\n * @returns {TTryResult<DataType>} A {@link TTryResult} containing either the result\n * ({@link TTryResult.Data}) or error {@link TTryResult.Error}.\n *\n * @example\n * // With an `async` function,\n * async function GetName(): Promise<string> { ... }\n * // Or, with a `Promise`,\n * const GetName: Promise<string> = new Promise<string>(...);\n *\n * // For both of the above cases, `Try` behaves the same:\n * const { Data: Name, Error: NameError } = await Try(GetName);\n * // If `GetName` returned,\n * // `typeof Name` <- `\"string\"`\n * // `typeof NameError` <- `\"undefined\"`\n * // If `GetName` threw,\n * // `typeof Name` <- `\"undefined\"`\n * // `NameError !== undefined` <- `true` (Unless `GetName` threw `undefined`).\n */\nexport async function Try<DataType>(Source: TTrySource<DataType>): Promise<TTryResult<DataType>> {\n try {\n const Data: DataType = typeof Source === \"function\"\n ? await Source()\n : await Source;\n return {\n Data,\n Error: undefined\n };\n }\n catch (ErrorValue: unknown) {\n return {\n Data: undefined,\n Error: ErrorValue\n };\n }\n}\n/**\n * A cleaner way of using `Array.prototype.map` with an `async` function.\n *\n * @template ArgumentElementType - The type of the given {@link Elements}.\n * @template ReturnElementType - The type of the `Array` returned by this.\n *\n * @param Elements - The `Array` that will be transformed.\n * @param Mapper - The function that maps each {@link ArgumentElementType}\n * to a {@link ReturnElementType}.\n *\n * @returns {Array<ReturnElementType>} An `Array` of {@link ReturnElementType}.\n *\n * @example\n * In an `async` function,\n * ```typescript\n * const ArgumentElements: Array<ArgumentElementType> = [ ... ];\n * const ToReturnElement = async (Element: ArgumentElementType): Promise<ReturnElementType> => ...;\n * const ReturnElements: Array<ReturnElementType> = await Map(ArgumentElements, ToReturnElement);\n * ```\n */\nexport async function Map<ArgumentElementType, ReturnElementType>(Elements: Array<ArgumentElementType>, Mapper: ((Element: ArgumentElementType) => Promise<ReturnElementType>)): Promise<Array<ReturnElementType>> {\n const MapperWrapped = async (Element: ArgumentElementType): Promise<ReturnElementType> => {\n return Mapper(Element);\n };\n const Out: Array<Promise<ReturnElementType>> = Elements.map(MapperWrapped);\n return await Promise.all(Out);\n}\n/**\n * An abstract implementation of {@link PromiseLike}. This exists only to maintain the\n * project's naming convention.\n */\nexport abstract class TPromiseLike<ResolveType> implements PromiseLike<ResolveType> {\n public then<ResultType = ResolveType, RejectType = never>(_OnFulfilled?: TOnFulfilled<ResolveType, ResultType>, _OnRejected?: TOnRejected<RejectType>): TPromiseLike<ResultType | RejectType> {\n throw new AbstractMethodCallError(\"TPromiseLike\");\n }\n}\n/**\n * The {@link TypeError} that is thrown by the constructor of {@link TPromise}\n * iff it receives an argument that is not a {@link TPromiseCtorArgument}.\n * It does not provide any additional information (in particular, it does not\n * add any properties, and it does not set any properties inherited from\n * {@link TypeError}).\n *\n * @note While the argument type of {@link TPromise}'s constructor is checked at runtime,\n * the type checker should prevent the error described by this from happening.\n */\nexport class FPromiseInstantiationError extends TypeError {\n public constructor() {\n super();\n }\n}\n/**\n * A `then`-able wrapper of {@link Promise}.\n *\n * @template ResolveType - The type to which this resolves, if it does resolve.\n */\nexport class TPromise<ResolveType> extends TPromiseLike<ResolveType> implements PromiseLike<ResolveType> {\n public constructor(Argument: TPromiseCtorArgument<ResolveType>) {\n super();\n if (typeof Argument === \"function\") {\n this.Underlying = new Promise<ResolveType>(Argument);\n }\n else {\n if (Argument instanceof TPromise) {\n this.Underlying = Argument.Raw();\n }\n else if (Argument instanceof Promise) {\n this.Underlying = Argument;\n }\n }\n throw new FPromiseInstantiationError();\n }\n private readonly Underlying: Promise<ResolveType>;\n /**\n * This class's extension of {@link Promise!then}.\n *\n * @template ResultType - The type to which the value underlying the {@link TPromise} returned by this\n * will resolve, if the {@link TPromise} resolves.\n *\n * @template RejectType - The type to which the value underlying the {@link TPromise} returned by this\n * will reject, if the {@link TPromise} rejects.\n *\n * @param OnFulfilled - The callback that is called when the underlying {@link Promise} resolves,\n * if it resolves.\n *\n * @param OnRejected - The callback that is called when the underlying {@link Promise} rejects,\n * if it rejects.\n *\n * @returns {TPromise<ResultType | RejectType>} A new {@link TPromise} of the result of the\n * given callbacks.\n *\n * @example\n * ```typescript\n * const Example: TPromise<string> = new TPromise<string>((Resolve, Reject) =>\n * {\n * if (Math.random() < 0.5)\n * {\n * Resolve(\"Success\");\n * }\n * else\n * {\n * Reject(\"Error\");\n * }\n * });\n *\n * Example.then(\n * (Value: string): void =>\n * {\n * // `Value` <- `\"Success\"`\n * },\n * (Reason: unknown): void =>\n * {\n * // `Reason` <- `\"Error\"`\n * }\n * );\n * ```\n */\n public Then<ResultType = ResolveType, RejectType = never>(OnFulfilled: TOnFulfilled<ResolveType, ResultType>, OnRejected?: TOnRejected<RejectType>): TPromise<ResultType | RejectType> {\n return new TPromise<ResultType | RejectType>(this.Underlying.then(OnFulfilled, OnRejected));\n }\n public override then<ResultType = ResolveType, RejectType = never>(OnFulfilled?: TOnFulfilled<ResolveType, ResultType>, OnRejected?: TOnRejected<RejectType>): TPromise<ResultType | RejectType> {\n return new TPromise<ResultType | RejectType>(this.Underlying.then(OnFulfilled, OnRejected));\n }\n public Catch<ResultType = never>(OnRejected?: TNullable<TOnRejected<ResolveType>>): TPromiseLike<ResolveType | ResultType> {\n return new TPromise<ResolveType | ResultType>(this.Underlying.catch(OnRejected));\n }\n public Finally(OnFinally?: TNullable<TFunction>): TPromise<ResolveType> {\n return new TPromise(this.Underlying.finally(OnFinally));\n }\n public static Resolve<ResolveType>(Value: ResolveType | PromiseLike<ResolveType>): TPromise<Awaited<ResolveType>> {\n return new TPromise(Promise.resolve(Value));\n }\n public static Reject<ResolveType = unknown>(Reason?: unknown): TPromise<ResolveType> {\n return new TPromise(Promise.reject<ResolveType>(Reason));\n }\n public Raw(): Promise<ResolveType> {\n return this.Underlying;\n }\n}\n;\n", "/**\n * @file Complex.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nimport { MathBuiltin } from \"./Complex.Internal\";\nimport { Operator } from \"tsover-runtime\";\n/**\n * Elements of the complex plane, $\\mathbf{C} = \\mathbf{R}[x] / [ x^2 + 1 ]$.\n */\nexport class FComplex {\n public readonly Re: number;\n public readonly Im: number;\n public static Zero: FComplex = new FComplex(0, 0);\n /**\n * The copy constructor for {@link FComplex} numbers.\n *\n * @param Z - The existing {@link FComplex} number to copy.\n *\n * @example\n * ```typescript\n * const Z: FComplex = 3 + 2 * i;\n * const W: FComplex = new FComplex(Z);\n * // `W.Re === Z.Re` <- `true`\n * // `W.Im === Z.Im` <- `true`\n * ```\n */\n public constructor(Z: FComplex);\n /**\n * Construct an {@link FComplex} number by specifying the real\n * and imaginary components.\n *\n * @param A - The real component of the {@link FComplex} number.\n * @param B - The imaginary component of the {@link FComplex} number.\n *\n * @example\n * ```typescript\n * const Theta: number = 0.5;\n * const OnUnitDisk: FComplex = new FComplex(Math.sin(Theta), Math.cos(Theta));\n * ```\n */\n public constructor(A: number, B: number);\n public constructor(A: FComplex | number, B: number = 0) {\n if (typeof A === \"number\") {\n this.Re = A;\n this.Im = B;\n }\n else {\n this.Re = A.Re;\n this.Im = A.Im;\n }\n }\n /**\n * Get the modulus of this {@link FComplex} number.\n *\n * @returns {number} The modulus of this {@link FComplex} number.\n */\n public get Mod(): number {\n return MathBuiltin.sqrt((this.Re ** 2) + (this.Im ** 2));\n }\n /**\n * Get the modulus of this {@link FComplex} number.\n *\n * @returns {number} The modulus of this {@link FComplex} number.\n */\n public get Theta(): number {\n const Out: number = MathBuiltin.atan2(this.Im, this.Re);\n if (Out < 0) {\n return Out + 2 * MathBuiltin.PI;\n }\n return Out;\n }\n [Operator.star](A: FComplex, B: FComplex): FComplex;\n [Operator.star](A: FComplex, B: number): FComplex;\n [Operator.star](A: number, B: FComplex): FComplex;\n [Operator.star](A: FComplex | number, B: number | FComplex): FComplex {\n if (typeof A === \"number\") {\n return new FComplex((B as FComplex).Re * A, (B as FComplex).Im * A);\n }\n else if (typeof B === \"number\") {\n return new FComplex((A as FComplex).Re * B, (A as FComplex).Im * B);\n }\n else {\n return new FComplex((((A as FComplex).Re + (B as FComplex).Re) -\n ((A as FComplex).Im + (B as FComplex).Im)), (((A as FComplex).Re + (B as FComplex).Im) +\n ((B as FComplex).Re + (A as FComplex).Im)));\n }\n }\n [Operator.plus](A: FComplex, B: FComplex): FComplex;\n [Operator.plus](A: FComplex, B: number): FComplex;\n [Operator.plus](A: number, B: FComplex): FComplex;\n [Operator.plus](A: FComplex | number, B: number | FComplex): FComplex {\n if (typeof A === \"number\") {\n return new FComplex(A + (B as FComplex).Re, (B as FComplex).Im);\n }\n else if (typeof B === \"number\") {\n return new FComplex((A as FComplex).Re + B, (A as FComplex).Im);\n }\n else {\n return new FComplex((A as FComplex).Re + (B as FComplex).Re, (A as FComplex).Im + (B as FComplex).Im);\n }\n }\n}\nexport /**\n * The imaginary unit.\n */ const i: FComplex = new FComplex(0, 1);\n", "/**\n * @file Complex.Internal.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nexport const MathBuiltin: typeof Math = Math;\n", "/**\n * @file index.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nexport * from \"./FileSystem.ts\";\nexport * from \"./FileSystem.Types.ts\";\n", "/**\n * @file FileSystem.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nimport { basename, dirname, extname, join } from \"path\";\nimport { type FFileExtension } from \"./FileSystem.Types.ts\";\nimport { type FileHandle } from \"fs/promises\";\nimport { promises as Fs } from \"fs\";\nimport { constants as FsConstants } from \"fs\";\nimport os from \"os\";\nasync function PathExists(Path: string): Promise<boolean> {\n try {\n await Fs.access(Path, FsConstants.F_OK);\n return true;\n }\n catch {\n return false;\n }\n}\n/**\n * @param Extension - The file extension that you wish to test.\n * @returns Whether the file extension is valid on the current platform.\n */\nexport function IsSupportedFileExtension(Extension: FFileExtension): boolean {\n let NormalizedExtension: string = Extension.slice(1);\n if (NormalizedExtension.startsWith(\".\")) {\n NormalizedExtension = NormalizedExtension.slice(1);\n }\n if (NormalizedExtension.length === 0) {\n return false;\n }\n if (NormalizedExtension.includes(\"/\")\n || NormalizedExtension.includes(\"\\\\\")\n || NormalizedExtension.includes(\"\\0\")) {\n return false;\n }\n if (os.platform() === \"win32\") {\n /* eslint-disable-next-line no-control-regex */\n const HasIllegalCharacters: boolean = /[<>:\"/\\\\|?*\\x00-\\x1F]/u.test(NormalizedExtension);\n if (HasIllegalCharacters) {\n return false;\n }\n if (/[ .]$/u.test(NormalizedExtension)) {\n return false;\n }\n }\n return true;\n}\n/**\n * Given a path at which we wish to create a new file, check if a file at that\n * path already exists, and if so, then append `(${ number })` before the file\n * extension, consistent with the Windows Explorer handles conflicting file\n * names when pasting files.\n */\nexport async function GetSafeNewPath(InPath: string): Promise<string> {\n const DirectoryPath: string = dirname(InPath);\n const Extension: string = extname(InPath);\n const FileName: string = basename(InPath);\n const BaseFileName: string = Extension === \"\"\n ? FileName\n : basename(InPath, Extension);\n let CandidatePath: string = InPath;\n let Index: number = 1;\n while (await PathExists(CandidatePath)) {\n const CandidateFileName: string = `${BaseFileName} (${Index})${Extension}`;\n CandidatePath = join(DirectoryPath, CandidateFileName);\n Index++;\n }\n return CandidatePath;\n}\n/**\n * @param DirectoryPath - The path to the directory in which you wish to check.\n * @param FileName - The desired file name.\n * @param PersistNewFile - *(Optional)* Whether to keep the otherwise-temporary\n * file created at the desired path.\n * @param Extension - *(Optional)* If provided, the function will only return `true`\n * if `FileName.endsWith(Extension)` *and* the `Extension` is a valid\n * file extension.\n * @returns Whether a file of the given `FileName` can be created in `DirectoryPath`.\n *\n * @remarks This *does* attempt to create a file at the desired path. The file is\n * temporary iff `!PersistNewFile`, and is never created when this function\n * returns `false`.\n */\nexport async function IsValidFileName(DirectoryPath: string, FileName: string, PersistNewFile: boolean = false, Extension: FFileExtension | undefined = undefined): Promise<boolean> {\n const ExtensionSafe: FFileExtension | null | \"\" = Extension !== undefined\n ? (Extension.startsWith(\".\") && IsSupportedFileExtension(Extension))\n ? Extension\n : null\n : \"\";\n const IsExtensionImproper: boolean = (ExtensionSafe === null ||\n ExtensionSafe === \".\" ||\n !FileName.endsWith(ExtensionSafe));\n if (IsExtensionImproper) {\n return false;\n }\n const FilePath: string = join(DirectoryPath, FileName);\n try {\n const ThisFileHandle: FileHandle = await Fs.open(FilePath, \"wx\");\n await ThisFileHandle.close();\n if (!PersistNewFile) {\n await Fs.unlink(FilePath);\n }\n return true;\n }\n catch {\n return false;\n }\n}\n/**\n * Write a text file to a given {@link Path} having contents {@link Contents}.\n *\n * @param Path - The path of the file that will be written.\n * @param Contents - The text contents of the file to write.\n *\n * @returns {Promise<void>} A {@link Promise} that resolves when the call to {@link Fs.writeFile} resolves.\n *\n * @example\n * ```typescript\n * import { WriteTextFile } from \"@sorrell/utilities/fs\";\n * import { resolve } from \"path\";\n *\n * const MyReadMe: string = \"# ReadMe\\n\\nThis package accomplishes...\\n\";\n * const MyReadMePath: string = resolve(\".\");\n *\n * await WriteTextFile(MyReadMePath, MyReadMe);\n * ```\n */\nexport async function WriteTextFile(Path: string, Contents: string): Promise<void> {\n await Fs.writeFile(Path, Contents, { encoding: \"utf-8\" });\n}\nimport * as FileSystem from \"node:fs/promises\";\nimport * as Path from \"node:path\";\nimport * as Readline from \"node:readline\";\ntype DeletePhase = \"Scanning\" | \"Deleting\" | \"Done\";\ntype DeleteEntryKind = \"File\" | \"Directory\" | \"Other\";\ntype DeleteEntry = {\n EntryPath: string;\n Kind: DeleteEntryKind;\n Size: number;\n};\ntype DeleteProgress = {\n Phase: DeletePhase;\n CurrentPath: string | null;\n DiscoveredEntries: number;\n TotalEntries: number;\n DeletedEntries: number;\n TotalBytes: number;\n DeletedBytes: number;\n};\ntype DeleteWithProgressOptions = {\n OnProgress?: (Progress: DeleteProgress) => void;\n Signal?: AbortSignal;\n};\nfunction IsMissingFileError(ErrorValue: unknown): boolean {\n return (typeof ErrorValue === \"object\" &&\n ErrorValue !== null &&\n \"code\" in ErrorValue &&\n ErrorValue.code === \"ENOENT\");\n}\nfunction CloneProgress(Progress: DeleteProgress): DeleteProgress {\n return { ...Progress };\n}\nasync function BuildDeletionPlan(RootPath: string, Progress: DeleteProgress, Options: DeleteWithProgressOptions): Promise<DeleteEntry[]> {\n const Entries: DeleteEntry[] = [];\n async function Visit(CurrentPath: string): Promise<void> {\n Options.Signal?.throwIfAborted();\n Progress.Phase = \"Scanning\";\n Progress.CurrentPath = CurrentPath;\n Options.OnProgress?.(CloneProgress(Progress));\n let Stats;\n try {\n Stats = await FileSystem.lstat(CurrentPath);\n }\n catch (ErrorValue) {\n if (IsMissingFileError(ErrorValue)) {\n return;\n }\n throw ErrorValue;\n }\n if (Stats.isDirectory()) {\n const Children = await FileSystem.readdir(CurrentPath, {\n withFileTypes: true\n });\n for (const Child of Children) {\n await Visit(Path.join(CurrentPath, Child.name));\n }\n Entries.push({\n EntryPath: CurrentPath,\n Kind: \"Directory\",\n Size: 0\n });\n }\n else {\n const Size = Stats.isFile() ? Stats.size : 0;\n Entries.push({\n EntryPath: CurrentPath,\n Kind: Stats.isFile() ? \"File\" : \"Other\",\n Size\n });\n Progress.TotalBytes += Size;\n }\n Progress.DiscoveredEntries = Entries.length;\n Options.OnProgress?.(CloneProgress(Progress));\n }\n await Visit(RootPath);\n return Entries;\n}\nexport async function DeleteWithProgress(RootPath: string, Options: DeleteWithProgressOptions = {}): Promise<void> {\n const Progress: DeleteProgress = {\n Phase: \"Scanning\",\n CurrentPath: null,\n DiscoveredEntries: 0,\n TotalEntries: 0,\n DeletedEntries: 0,\n TotalBytes: 0,\n DeletedBytes: 0\n };\n const Entries = await BuildDeletionPlan(RootPath, Progress, Options);\n Progress.Phase = \"Deleting\";\n Progress.TotalEntries = Entries.length;\n Progress.CurrentPath = null;\n Options.OnProgress?.(CloneProgress(Progress));\n for (const Entry of Entries) {\n Options.Signal?.throwIfAborted();\n Progress.CurrentPath = Entry.EntryPath;\n Options.OnProgress?.(CloneProgress(Progress));\n try {\n if (Entry.Kind === \"Directory\") {\n await FileSystem.rmdir(Entry.EntryPath);\n }\n else {\n await FileSystem.unlink(Entry.EntryPath);\n }\n }\n catch (ErrorValue) {\n if (!IsMissingFileError(ErrorValue)) {\n throw ErrorValue;\n }\n }\n Progress.DeletedEntries += 1;\n Progress.DeletedBytes += Entry.Size;\n Options.OnProgress?.(CloneProgress(Progress));\n }\n Progress.Phase = \"Done\";\n Progress.CurrentPath = null;\n Options.OnProgress?.(CloneProgress(Progress));\n}\nfunction FormatBytes(Bytes: number): string {\n const Units = [\"B\", \"KB\", \"MB\", \"GB\", \"TB\"];\n let Value = Bytes;\n let UnitIndex = 0;\n while (Value >= 1024 && UnitIndex < Units.length - 1) {\n Value /= 1024;\n UnitIndex += 1;\n }\n return `${Value.toFixed(UnitIndex === 0 ? 0 : 1)} ${Units[UnitIndex]}`;\n}\n", "/**\n * @file index.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nexport * from \"./Functional.ts\";\nexport * from \"./Functional.Types.ts\";\n", "/**\n * @file Functional.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\n/* eslint-disable jsdoc/require-example */\n/**\n * The identity mapping, for some {@link Array} of {@link ArgumentVector | given arguments}.\n *\n * @param ArgumentVector - The {@link Array} of given arguments.\n * @returns {typeof ArgumentVector} The {@link Array} of given arguments.\n */\nexport function Identity<ArgumentType>(...ArgumentVector: Array<ArgumentType>): typeof ArgumentVector {\n return ArgumentVector;\n}\n/* eslint-enable jsdoc/require-example */\n", "/**\n * @file index.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\n/**\n * @module Math\n * Functions, types, and classes for mathematical computations.\n */\nexport * as Complex from \"./Index.Complex.ts\";\nexport * as Vector from \"./Vector.ts\";\nexport * from \"./Math.ts\";\nexport * from \"./Math.Types.ts\";\n", "/**\n * @file Index.Complex.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nexport * from \"./Complex.ts\";\nexport * from \"./Complex.Types.ts\";\n", "/**\n * @file Vector.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nimport { Operator } from \"tsover-runtime\";\n/** A representation of elements in $\\mathbf{R}^2$. */\nexport class FVector2D {\n /** The $x$-component of this vector. */\n public readonly X: number;\n /** The $y$-component of this vector. */\n public readonly Y: number;\n /** The identity of $\\mathbf{R}^2$ *wrt* addition. */\n public static Zero: FVector2D = new FVector2D(0, 0);\n /**\n * Construct a vector by specifying both components.\n *\n * @param Value - The value of both the {@link FVector2D!X | x}- and\n * {@link FVector2D!Y ? y}-components.\n */\n public constructor(Value: number);\n /**\n * Construct a vector by specifying both components.\n *\n * @param X - The value of the {@link FVector2D!X} component.\n * @param Y - The value of the {@link FVector2D!Y} component.\n */\n public constructor(X: number, Y: number);\n public constructor(X: number = 0, Y: number = X) {\n this.X = X;\n this.Y = Y;\n }\n /**\n * Get a representation of this vector as a `string`.\n *\n * @returns {string} The string representation of this vector.\n */\n public toString(): string {\n return `(${this.X}, ${this.Y})`;\n }\n /**\n * Perform per-component addition of two {@link FVector2D}s.\n *\n * @param Left - The left-hand operand.\n * @param Right - The right-hand operand.\n *\n * @returns {FVector2D} The per-component sum of {@link Left} and {@link Right}.\n *\n * @example\n * ```typescript\n * \"use tsover\";\n *\n * const A: FVector2D = new FVector2D(1, -1);\n * const B: FVector2D = new FVector2D(-3, 5);\n *\n * const C: FVector2D = A + B;\n * // `C` <- `(-2, 4)`\n * ```\n */\n [Operator.plus](Left: FVector2D, Right: FVector2D): FVector2D {\n return new FVector2D(Left.X + Right.X, Left.Y + Right.Y);\n }\n [Operator.minus](A: FVector2D, B: FVector2D): FVector2D {\n return new FVector2D(A.X - B.X, A.Y - B.Y);\n }\n [Operator.preMinus](Vector: FVector2D): FVector2D {\n return new FVector2D(-1 * Vector.X, -1 * Vector.Y);\n }\n /**\n * Perform scalar multiplication of an {@link FVector2D} and a `number` value.\n * Exactly one of the two arguments must be a `number`, and the other an\n * {@link FVector2D}.\n *\n * @param Left - The left-hand operand (either a `number` or an {@link FVector2D}).\n * @param Left - The right-hand operand (either a `number` or an {@link FVector2D}).\n *\n * @returns {FVector2D} The per-component sum of {@link Left} and {@link Right}.\n */\n [Operator.star](Left: number, Right: FVector2D): FVector2D;\n [Operator.star](Left: FVector2D, Right: number): FVector2D;\n [Operator.star](Left: FVector2D | number, Right: FVector2D | number): FVector2D | typeof Operator.deferOperation {\n if (typeof Left === \"number\" && Right instanceof FVector2D) {\n return new FVector2D(Left * Right.X, Left * Right.Y);\n }\n if (typeof Right === \"number\" && Left instanceof FVector2D) {\n return new FVector2D(Left.X * Right, Left.Y * Right);\n }\n return Operator.deferOperation;\n }\n public get length(): number {\n return Math.sqrt((this.X ** 2) + (this.Y ** 2));\n }\n public get Length(): number {\n return this.length;\n }\n}\n/** A representation of elements in $\\mathbf{R}^3$. */\nexport class FVector {\n public readonly X: number;\n public readonly Y: number;\n public readonly Z: number;\n /** Constructs the zero {@link FVector}. */\n public constructor();\n /**\n * Constructs an {@link FVector} with all components set to {@link Value}.\n *\n * @param Value - The value of all components of the new {@link FVector}.\n */\n public constructor(Value: number);\n /**\n * Constructs an {@link FVector} with all components set to {@link Value}.\n *\n * @param X - The value of the {@link FVector!X} component.\n * @param Y - The value of the {@link FVector!Y} component.\n * @param Z - The value of the {@link FVector!Z} component.\n */\n public constructor(X: number, Y: number, Z: number);\n public constructor(X: number = 0, Y: number = X, Z: number = X) {\n this.X = X;\n this.Y = Y;\n this.Z = Z;\n }\n [Operator.plus](Left: FVector, Right: FVector): FVector {\n return new FVector(Left.X + Right.X, Left.Y + Right.Y, Left.Z + Right.Z);\n }\n [Operator.minus](A: FVector, B: FVector): FVector {\n return new FVector(A.X - B.X, A.Y - B.Y, A.Z - B.Z);\n }\n [Operator.preMinus](Vector: FVector): FVector {\n return new FVector(-1 * Vector.X, -1 * Vector.Y, -1 * Vector.Z);\n }\n [Operator.star](Left: number, Right: FVector): FVector;\n [Operator.star](Left: FVector, Right: number): FVector;\n [Operator.star](Left: FVector | number, Right: FVector | number): FVector | typeof Operator.deferOperation {\n if (typeof Left === \"number\" && Right instanceof FVector) {\n return new FVector(Left * Right.X, Left * Right.Y, Left * Right.Z);\n }\n if (typeof Right === \"number\" && Left instanceof FVector) {\n return new FVector(Left.X * Right, Left.Y * Right, Left.Z * Right);\n }\n return Operator.deferOperation;\n }\n public get length(): number {\n return Math.sqrt((this.X ** 2) + (this.Y ** 2) + (this.Z ** 2));\n }\n public get Length(): number {\n return this.length;\n }\n}\n", "/**\n * @file Math.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\n/* eslint-disable */\nexport const __DummyExport_Number: \"DummyExport\" = \"DummyExport\" as const;\n", "/**\n * @file index.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nexport * from \"./Utility.Types.ts\";\n", "/**\n * @file index.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\n/**\n * @module Npm\n * Utilities for working with `npm` (NodeJS) packages.\n * Many of these likely work with packages of other NodeJS\n * package managers and adjacent runtimes (*e.g.*, `bun` or `deno`).\n */\nexport * from \"./Npm.ts\";\nexport * from \"./Npm.Error.ts\";\n", "/**\n * @file Npm.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nimport { promises as Fs, constants as FsConstants } from \"fs\";\nimport { PackageJsonParseError, RootDirectoryNotFoundError } from \"./Npm.Error.ts\";\nimport { dirname, join } from \"path\";\nimport type { IPackageJson } from \"package-json-type\";\nimport Process from \"process\";\n/**\n * Get the `package.json` of the Node.js project in which the\n * given path, or the current working directory, resides.\n *\n * @param Path - The given path from which to look for a root directory.\n *\n * @throws {RootDirectoryNotFoundError | PackageJsonParseError} An error\n * describing either failure to identify a root directory, or failing to\n * parse the discovered `package.json`.\n *\n * @returns {Promise<IPackageJson>} The {@link IPackageJson} of {@link Path}\n * if provided, otherwise of `process.cwd()`.\n *\n * @example\n * Suppose `process.cwd() === \"./MyPackage\"`,\n * ```typescript\n * const PackageJson: IPackageJson = await GetPackageJson();\n * // `PackageJson` <- *The parsed `package.json` of `MyPackage`.*\n * ```\n */\nexport async function GetPackageJson(Path?: string): Promise<IPackageJson> {\n const RootDirectory: string = await GetPackageRootDirectory(Path);\n const PackageJsonPath: string = join(RootDirectory, \"package.json\");\n const FileContents: string = await Fs.readFile(PackageJsonPath, \"utf-8\");\n const PackageJson: IPackageJson = await (async (): Promise<IPackageJson> => {\n try {\n return JSON.parse(FileContents) as IPackageJson;\n }\n catch (Cause: unknown) {\n throw new PackageJsonParseError({ Cause, Path: PackageJsonPath });\n }\n })();\n return PackageJson;\n}\n/**\n * Get the root directory of the Node.js project in which the\n * current working directory resides.\n *\n * @param Path - The given path from which to look for a root directory.\n *\n * @throws {RootDirectoryNotFoundError} An error iff the root directory\n * of a NodeJS package could not be found.\n *\n * @returns {Promise<string>} The path to the root directory of the package\n * containing {@link Path} if specified, otherwise containing `process.cwd()`.\n *\n * @example\n * Suppose `process.cwd()` is any one of the following,\n * - `/home/alex/myPackage`,\n * - `/home/alex/myPackage/src/MyModule`,\n * - `/home/alex/myPackage/resource/Images`,\n *\n * then,\n *\n * ```typescript\n * const Root: string = await GetPackageRootDirectory();\n * // `Root` <- `\"/home/alex/myPackage\"`\n * ```\n *\n * @example\n * Suppose `TestPath === \"/home/alex/Documents\"` is *not* a NodeJS package root\n * (of course, neither are `/home/alex` or `/home`). Then,\n *\n * ```typescript\n * const TestPath: string = \"/home/alex/Documents\";\n * let Root: string | undefined = undefined;\n * try\n * {\n * Root = await GetPackageRootDirectory(TestPath);\n * }\n * catch (Error: unknown)\n * {\n * // `Error instanceof RootDirectoryNotFound`\n * }\n *\n * // `Root` <- `undefined`\n * ```\n *\n * @example\n * Suppose `process.cwd() === /home/alex/Downloads`, which is *not* a NodeJS package\n * (of course, neither are `/home/alex` or `/home`). Then,\n *\n * ```typescript\n * let Root: string | undefined = undefined;\n * try\n * {\n * Root = await GetPackageRootDirectory();\n * }\n * catch (Error: unknown)\n * {\n * // `Error instanceof RootDirectoryNotFound`\n * }\n * // `Root` <- `undefined`\n * ```\n */\nexport async function GetPackageRootDirectory(Path?: string): Promise<string> {\n let CurrentDirectory: string = await Fs.realpath(Path ?? Process.cwd());\n while (true) {\n const PackageJsonPath: string = join(CurrentDirectory, \"package.json\");\n const PackageJsonExists: boolean = await (async (): Promise<boolean> => {\n try {\n await Fs.access(PackageJsonPath, FsConstants.F_OK);\n return true;\n }\n catch {\n return false;\n }\n })();\n if (PackageJsonExists) {\n return CurrentDirectory;\n }\n const ParentDirectory: string = dirname(CurrentDirectory);\n if (ParentDirectory === CurrentDirectory) {\n throw new RootDirectoryNotFoundError({ Path });\n }\n CurrentDirectory = ParentDirectory;\n }\n}\n", "/**\n * @file Npm.Error.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nimport { Data } from \"effect\";\n/**\n * An error describing that {@link GetPackageJson} failed to parse the discovered `package.json` file.\n *\n * @property {string | undefined} Path - The `Path` argument passed to the effect returning this error,\n * if one was given.\n * @property {unknown} Cause - The cause of this error.\n */\nexport class PackageJsonParseError extends Data.TaggedError(\"PackageJsonParseError\")<{\n readonly Path: string | undefined;\n readonly Cause: unknown;\n}> {\n}\n/**\n * An error describing that {@link GetPackageRootDirectory} failed.\n *\n * @property {string | undefined} Path - The `Path` argument passed to the effect returning\n * this error, if one was given.\n */\nexport class RootDirectoryNotFoundError extends Data.TaggedError(\"RootDirectoryNotFound\")<{\n readonly Path: string | undefined;\n}> {\n}\n", "/**\n * @file index.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nexport * from \"./Path.ts\";\n", "/**\n * @file Path.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nimport { join } from \"path\";\nimport { Operator } from \"tsover-runtime\";\nexport class FPath {\n public readonly Raw: string;\n public toString(): string {\n return this.Raw;\n }\n public constructor(String: string);\n public constructor(Other: FPath);\n public constructor(Argument: string | FPath) {\n if (typeof Argument === \"string\") {\n this.Raw = Argument;\n }\n else {\n this.Raw = Argument.Raw;\n }\n }\n [Operator.slash](A: FPath, B: FPath): FPath;\n [Operator.slash](A: string, B: FPath): FPath;\n [Operator.slash](A: FPath, B: string): FPath;\n [Operator.slash](A: FPath | string, B: FPath | string): FPath {\n if (typeof A === \"string\") {\n return new FPath(join(A, (B as FPath).Raw));\n }\n else if (typeof B === \"string\") {\n return new FPath(join((A as FPath).Raw, B));\n }\n else {\n return new FPath(join((A as FPath).Raw, (B as FPath).Raw));\n }\n }\n}\n", "/**\n * @file index.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nexport * from \"./Record.ts\";\nexport type { RecordNonNullable as NonNullable } from \"./Record.Meta.ts\";\nexport * from \"./Record.Types.ts\";\n", "/**\n * @file Record.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nimport type { FlatMapper, FromPath, Mapper, Path, Walkable } from \"./Record.Types.ts\";\nimport type { Ref } from \"../Miscellaneous/Utility.Types.ts\";\n// @TODO Write example for `SetPropertyFromPath`.\n/* eslint-disable jsdoc/require-example */\n/**\n * Set a value within a given {@link InRecord | Record} at a given {@link Path} to be a given\n * {@link Value}.\n *\n * @param InRecord - The {@link Record} that holds the value with path {@link Path} to be retrieved\n * by this function.\n * @param Path - The {@link PathType} that describes the property to be retrieved by this.\n * @param Value - The value to be set at the given {@link Path} of the given {@link InRecord | Record}.\n *\n * @throws {Error} An {@link Error} iff the given {@link Path} is an {@link Array}, rather than a\n * `.`-delimited `string`.\n */\nexport function SetPropertyFromPath<RecordType extends Walkable, PathType extends Path<RecordType>>(InRecord: RecordType, Path: PathType, Value: FromPath<RecordType, PathType>): void {\n type FProperty = FromPath<RecordType, PathType>;\n if (Array.isArray(Path)) {\n throw new Error(\"SetPropertyFromPath does not support Array-based paths yet.\");\n }\n const PathSplit: Array<string> = Path.split(\".\");\n const Last: string | undefined = PathSplit.pop();\n if (Last === undefined) {\n return;\n }\n if (PathSplit.length === 0) {\n if (!Array.isArray(Path)) {\n ((InRecord.Ref as Record<string, unknown>)[(Path as string)]) = Value;\n }\n }\n const Recurrence = (In: unknown): unknown | undefined => {\n const NextPropertyNameBase: string | undefined = PathSplit.shift();\n if (NextPropertyNameBase !== undefined) {\n const NextPropertyName: string | number = isNaN(parseInt(NextPropertyNameBase))\n ? NextPropertyNameBase\n : parseInt(NextPropertyNameBase);\n const Out: unknown = (In as Record<string, unknown>)[NextPropertyName] as unknown;\n return Recurrence(Out);\n }\n else {\n return In;\n }\n };\n const PropertyRef: Ref<FProperty> = Recurrence(InRecord) as Ref<FProperty>;\n const LastTyped: string | number = isNaN(parseInt(Last))\n ? Last\n : parseInt(Last);\n (PropertyRef.Ref as Record<string, unknown>)[LastTyped] = Value;\n}\n;\n/* eslint-enable jsdoc/require-example */\n// @TODO Write example for `GetPropertyFromPath`.\n/* eslint-disable jsdoc/require-example */\n/**\n * Get a value within a given {@link InRecord | Record} at a given {@link Path}.\n *\n * @param InRecord - The {@link Record} that holds the value with path {@link Path} to be retrieved\n * by this function.\n * @param Path - The {@link PathType} that describes the property to be retrieved by this.\n *\n * @throws {Error} An {@link Error} iff the given {@link Path} is an {@link Array}, rather than a\n * `.`-delimited `string`.\n *\n * @returns {FromPath<RecordType, PathType>} The value in the {@link InRecord} at the given {@link Path}.\n */\nexport function GetPropertyFromPath<RecordType extends Record<string, unknown>, PathType extends Path<RecordType>>(InRecord: RecordType, Path: PathType): FromPath<RecordType, PathType> {\n if (Array.isArray(Path)) {\n throw new Error(\"GetPropertyFromPath does not support Array-based paths yet.\");\n }\n const PathSplit: Array<string> = Path.split(\".\");\n const Recurrence = (In: unknown, Index: number = 0): unknown => {\n const Key: string | number | undefined = isNaN(parseInt(PathSplit[Index] || \"\"))\n ? PathSplit[Index]\n : parseInt(PathSplit[Index] || \"\");\n if (Key !== undefined) {\n const Next: unknown = (In as Record<string, unknown>)[Key];\n if (Index !== PathSplit.length - 1) {\n return Recurrence(Next, Index + 1);\n }\n else {\n return Next;\n }\n }\n else {\n return undefined;\n }\n };\n return Recurrence(InRecord) as FromPath<RecordType, PathType>;\n}\n;\n/* eslint-enable jsdoc/require-example */\n/**\n * Creates a {@link Ref} of a given {@link Type}. Useful for passing\n * primitives to functions by-reference.\n *\n * @template Type - The type of the value wrapped by the returned {@link Ref}.\n *\n * @returns {Ref<Type>} A {@link Ref} of the given {@link Type}.\n */\nexport function MakeRef<Type>(): Ref<Type> {\n return {\n Ref: undefined\n } as Ref<Type>;\n}\n;\n// @TODO Write example for `MapRecord`.\n/* eslint-disable jsdoc/require-example */\n/**\n * Maps a {@link Record} to an {@link Array}.\n *\n * @param InRecord - The {@link Record} over which this function maps.\n * @param InFunction - The {@link FlatMapTransformer | transformer} that maps\n * the record to an {@link Array}.\n *\n * @returns {Array<ElementType>} An {@link Array} of elements, mapped from the given {@link InRecord}.\n */\nexport function Map<KeyType extends PropertyKey, PropertyType, ElementType>(InRecord: Record<KeyType, PropertyType>, InFunction: Mapper<KeyType, PropertyType, ElementType>): Array<ElementType> {\n return Object.keys(InRecord).map((InKey: string, Index: number): ElementType => {\n const Key: KeyType = InKey as KeyType;\n return InFunction(Key, InRecord[Key], Index);\n });\n}\n;\n/* eslint-enable jsdoc/require-example */\n// @TODO Write example for `FlatMap`.\n/* eslint-disable jsdoc/require-example */\n/**\n * Maps a {@link Record} to an {@link Array}.\n *\n * @param InRecord - The {@link Record} over which this function maps.\n * @param InFunction - The {@link FlatMapTransformer | transformer} that maps\n * the record to an {@link Array}.\n *\n * @returns {Array<ElementType>} An {@link Array} of elements, mapped from the given {@link InRecord}.\n */\nexport function FlatMap<KeyType extends PropertyKey, PropertyType, ElementType>(InRecord: Record<KeyType, PropertyType>, InFunction: FlatMapper<KeyType, PropertyType, ElementType>): Array<ElementType> {\n return Object.keys(InRecord).flatMap((InKey: string, Index: number): Array<ElementType> => {\n const Key: KeyType = InKey as KeyType;\n const Transform: ElementType | Array<ElementType> = InFunction(Key, InRecord[Key], Index);\n return Array.isArray(Transform)\n ? Transform\n : [Transform];\n });\n}\n/* eslint-enable jsdoc/require-example */\n", "/**\n * @file index.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nexport * from \"./String.ts\";\n", "/**\n * @file String.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\n/**\n * @module String\n * Functions for manipulating strings.\n */\n// @TODO TEMPORARY.\n/* eslint-disable jsdoc/require-example */\n/**\n * Does the given {@link TestString} contain only letters?\n * This is equivalent to Python's\n * {@link https://docs.python.org/3/library/stdtypes.html#str.isalpha | isalpha} function.\n *\n * @remarks This is an alias for {@link IsAlpha}.\n *\n * @param TestString - The string that you wish to test.\n *\n * @returns {boolean} Whether the given string contains *only* (Latin alphabet) letters.\n */\nexport function IsLetters(TestString: string): boolean {\n return /^[a-zA-Z]*$/.test(TestString);\n}\n/**\n * Does the given {@link TestString} contain only letters?\n * This is equivalent to Python's\n * {@link https://docs.python.org/3/library/stdtypes.html#str.isalpha | isalpha} function.\n *\n * @param TestString - The string that you wish to test.\n *\n * @returns {boolean} Whether the given string contains *only* (Latin alphabet) letters.\n */\nexport function IsAlpha(TestString: string): boolean {\n return IsLetters(TestString);\n}\n/**\n * Does the given {@link TestString} contain only digits?\n *\n * This is equivalent to Python's\n * {@link https://docs.python.org/3/library/stdtypes.html#str.isnumeric | isnumeric} function.\n *\n * @param TestString - The string that you wish to test.\n *\n * @returns {boolean} Whether the given string contains *only* numeric digits.\n */\nexport function IsNumeric(TestString: string): boolean {\n return /^\\d+$/.test(TestString);\n}\n/**\n * This function provides a convenient way to define long strings across multiple lines.\n * The linebreaks and leading indentation are removed from the final string.\n * Please see the example below for how this is to be done.\n *\n * @param Content - The given string to dedent.\n * @param IndentLength - The number of spaces for which this function will check. This\n * is necessary only if the number of spaces used in the {@link Content} is not a multiple\n * of two.\n *\n * @returns {string} The given {@link Content}, but with the spaces at the beginning\n * of each line (excluding the first line if no spaces exist in the first line) removed.\n *\n * @example\n * ```typescript\n * import { Dedent } from \"@sorrell/utilities/string\";\n *\n * const MyLongString: string = Dedent(`Lorem ipsum dolor sit amet, consectetur adipiscing elit,\n * sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad\n * minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea\n * commodo consequat.`);\n *\n * // `MyLongString` <- `\"Lorem ipsum dolor sit amet, consectetur adipiscing elit, \\\n * sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad \\\n * minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea \\\n * commodo consequat.\"`\n * ```\n */\nexport function Dedent(Content: string, IndentLength?: number): string {\n const WhitespaceSubstring: string = ((): string => {\n if (IndentLength !== undefined) {\n return \"\\n\" + \" \".repeat(IndentLength);\n }\n let WhitespaceSubstring: string = \"\\n\";\n while (true) {\n const TestString: string = WhitespaceSubstring + \" \";\n if (Content.includes(TestString)) {\n WhitespaceSubstring = TestString;\n }\n else {\n break;\n }\n }\n return WhitespaceSubstring;\n })();\n return Content.replaceAll(WhitespaceSubstring, \"\");\n}\n", "/**\n * @file index.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nexport * from \"./TsConfig.Types.ts\";\n", "/**\n * @file index.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nexport * from \"./Tuple.Types.ts\";\n", "/**\n * @file index.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nexport * from \"./Test.Types.ts\";\nexport * from \"./Utility.Types.ts\";\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;;;ACgCO,SAAS,cAAuGA,QAAuH;AAC1O,SAAOA,OAAM,OAAO,CAAC,YAA8C;AAC/D,WAAO,YAAY;AAAA,EACvB,CAAC;AACL;;;ACpCA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACqBO,IAAM,0BAAN,cAAsC,MAAM;AAAA,EACxC,YAAY,WAAoB;AACnC,UAAM,SAAS;AAAA,EACnB;AACJ;;;ACiBA,eAAsB,IAAc,QAA6D;AAC7F,MAAI;AACA,UAAMC,QAAiB,OAAO,WAAW,aACnC,MAAM,OAAO,IACb,MAAM;AACZ,WAAO;AAAA,MACH,MAAAA;AAAA,MACA,OAAO;AAAA,IACX;AAAA,EACJ,SACO,YAAqB;AACxB,WAAO;AAAA,MACH,MAAM;AAAA,MACN,OAAO;AAAA,IACX;AAAA,EACJ;AACJ;AAqBA,eAAsB,IAA4C,UAAsC,QAA2G;AAC/M,QAAM,gBAAgB,OAAO,YAA6D;AACtF,WAAO,OAAO,OAAO;AAAA,EACzB;AACA,QAAM,MAAyC,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UAAU;AAC/B;AAWO,SAAS,UAAU,YAA6B;AACnD,SAAO,QAAQ,KAAK,UAAU;AAClC;AA6BO,SAAS,OAAO,SAAiB,cAA+B;AACnE,QAAM,uBAA+B,MAAc;AAC/C,QAAI,iBAAiB,QAAW;AAC5B,aAAO,OAAO,IAAI,OAAO,YAAY;AAAA,IACzC;AACA,QAAIC,uBAA8B;AAClC,WAAO,MAAM;AACT,YAAM,aAAqBA,uBAAsB;AACjD,UAAI,QAAQ,SAAS,UAAU,GAAG;AAC9B,QAAAA,uBAAsB;AAAA,MAC1B,OACK;AACD;AAAA,MACJ;AAAA,IACJ;AACA,WAAOA;AAAA,EACX,GAAG;AACH,SAAO,QAAQ,WAAW,qBAAqB,EAAE;AACrD;;;ACjGA;;;ACAA;;;ACAA;",
6
- "names": ["Array", "Data", "import_fs", "Path", "Fs", "FsConstants", "os", "import_tsover_runtime", "import_fs", "import_path", "Path", "Fs", "Process", "FsConstants", "import_path", "import_tsover_runtime", "Map", "Path", "Path", "Map", "WhitespaceSubstring"]
3
+ "sources": ["../Source/index.ts", "../Source/Array/index.ts", "../Source/Array/Array.ts", "../Source/Async/index.ts", "../Source/Miscellaneous/Utility.Types.ts", "../Source/Async/Async.ts", "../Source/Math/Complex.ts", "../Source/Math/Complex.Internal.ts", "../Source/FileSystem/index.ts", "../Source/FileSystem/FileSystem.ts", "../Source/FileSystem/Module/index.ts", "../Source/String/String.ts", "../Source/FileSystem/Module/Module.ts", "../Source/Functional/index.ts", "../Source/Functional/Functional.ts", "../Source/Math/index.ts", "../Source/Math/Index.Complex.ts", "../Source/Math/Vector.ts", "../Source/Math/Math.ts", "../Source/Miscellaneous/index.ts", "../Source/Npm/index.ts", "../Source/Npm/Npm.ts", "../Source/Npm/Npm.Error.ts", "../Source/Path/index.ts", "../Source/Path/Path.ts", "../Source/Record/index.ts", "../Source/Record/Record.ts", "../Source/String/index.ts", "../Source/TsConfig/index.ts", "../Source/Tuple/index.ts", "../Source/Type/index.ts"],
4
+ "sourcesContent": ["/**\n * @file index.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\n/**\n * @module\n * General-purpose utility types and functions.\n * This module barrel-exports each scoped export of this package.\n * Use the scoped exports of this package to access only specific\n * utilities (*e.g.*, `async`, `npm`, *etc.*).\n */\nexport * as Array from \"./Array/index.ts\";\nexport * as Async from \"./Async/index.ts\";\nexport * as Complex from \"./Math/Complex.ts\";\nexport * as FileSystem from \"./FileSystem/index.ts\";\nexport * as Functional from \"./Functional/index.ts\";\nexport * as Math from \"./Math/index.ts\";\nexport * as Miscellaneous from \"./Miscellaneous/index.ts\";\nexport * as Npm from \"./Npm/index.ts\";\nexport * as Path from \"./Path/index.ts\";\nexport * as Record from \"./Record/index.ts\";\nexport * as String from \"./String/index.ts\";\nexport * as TsConfig from \"./TsConfig/index.ts\";\nexport * as Tuple from \"./Tuple/index.ts\";\nexport * as Type from \"./Type/index.ts\";\n", "/**\n * @file index.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nexport * from \"./Array.ts\";\nexport * from \"./Array.Types.ts\";\n", "/**\n * @file Array.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nimport type { FilteredArray, Options, TArrayType } from \"./Array.Types.ts\";\nimport type { NoOptions } from \"../Option/Option.Types.ts\";\n/**\n * Filter out all instances of `undefined` from a given {@link Array:param}.\n * @param Array - The array to filter.\n *\n * @template ElementType - The type of the elements in the array.\n *\n * @returns {TArrayType<Exclude<ElementType, undefined>, Exclude<OptionsType, Options.MaybeDefined>>}\n * A new `Array` of type `Exclude<ElementType, undefined>` and `OptionsType` that is the given\n * {@link OptionsType}, with the {@link Options.MaybeDefined} option removed.\n *\n * @example With the given {@link ElementType} including `undefined`.\n * ```typescript\n * const MaybeOddNumbers: TArray<number | undefined> = [ 1, 3, undefined, 5 ];\n * const OddNumbers: TArray<number> = FilterDefined(MaybeOddNumbers);\n * ```\n * @example With the given {@link OptionsType} including `Options.MaybeDefined`.\n * ```typescript\n * const MaybeOddNumbers: TArray<number, Options.MaybeDefined> = [ 1, 3, undefined, 5 ];\n * const OddNumbers: TArray<number> = FilterDefined(MaybeOddNumbers);\n * ```\n */\nexport function FilterDefined<ElementType, OptionsType extends Options = NoOptions, ArraySize extends number = number>(Array: TArrayType<ElementType, OptionsType | Options.MaybeDefined, ArraySize>): FilteredArray<ElementType>;\nexport function FilterDefined<ElementType, OptionsType extends Options = NoOptions, ArraySize extends number = number>(Array: TArrayType<ElementType | undefined, OptionsType, ArraySize>): FilteredArray<ElementType>;\nexport function FilterDefined<ElementType, OptionsType extends Options = NoOptions, ArraySize extends number = number>(Array: TArrayType<ElementType | undefined, OptionsType | Options.MaybeDefined, ArraySize>): FilteredArray<ElementType>;\nexport function FilterDefined<ElementType, OptionsType extends Options = NoOptions, ArraySize extends number = number>(Array: TArrayType<ElementType | undefined, OptionsType | Options.MaybeDefined, ArraySize>): FilteredArray<ElementType> {\n return Array.filter((Element: ElementType | undefined): boolean => {\n return Element !== undefined;\n }) as FilteredArray<ElementType>;\n}\n", "/**\n * @file index.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nexport * from \"./Async.ts\";\nexport * from \"./Async.Types.ts\";\n", "/**\n * @file Utility.Types.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\n/**\n * A simple wrapper to allow passing primitives to functions by-reference.\n *\n * @template Type - The type of the value wrapped by this.\n */\nexport type Ref<Type> = {\n Ref: Type | undefined;\n};\n/**\n * The opposite of {@link NonNullable}: the union of a given {@link Type}, `null`, and `undefined`.\n *\n * @template Type - The nontrivial type in this union.\n */\nexport type TNullable<Type> = Type | null | undefined;\n/** An error that is thrown in default implementations of `abstract` `class`es. */\nexport class AbstractMethodCallError extends Error {\n public constructor(ClassName?: string) {\n super(ClassName);\n }\n}\n/**\n * A \"safe\" intersection of two types, such that if exactly one\n * of the two types is `never`, then this evaluates to the other type.\n * This evaluates to the intersection of the two types iff *both*\n * type parameters.\n *\n * @template LeftType - The first type parameter.\n * @template RightType - The second type parameter.\n */\nexport type TSafeIntersection<LeftType, RightType> = [\n LeftType\n] extends [\n never\n] ? [\n RightType\n] extends [\n never\n] ? never : RightType : [\n RightType\n] extends [\n never\n] ? LeftType : (LeftType & RightType);\n", "/**\n * @file Async.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nimport { AbstractMethodCallError, type TNullable } from \"../Miscellaneous/Utility.Types.ts\";\nimport type { TOnFulfilled, TOnRejected, TPromiseCtorArgument, TTryResult, TTrySource } from \"./Async.Types.ts\";\nimport type { TFunction } from \"../Functional/Functional.Types.ts\";\n/**\n * Implements \"Errors-as-values\" for `async` functions and `Promise<DataType>`s.\n *\n * If the `async` function or `Promise<DataType>` returns/resolves, then the `Error`\n * property of the returned object will be `undefined`, and the result of the\n * `async` function or `Promise<DataType>` will reside in the `Data` property of the\n * returned object.\n *\n * Similarly, if the `async` function or `Promise<DataType>` throws, then the `Data`\n * property of the returned object is `undefined`, and the `Error` property is what\n * was thrown to the `catch` block.\n *\n * @template DataType - The type of the data that the `async` function or `Promise<DataType>`.\n * @param Source - The `async` function or `Promise` to evaluate.\n *\n * @returns {TTryResult<DataType>} A {@link TTryResult} containing either the result\n * ({@link TTryResult.Data}) or error {@link TTryResult.Error}.\n *\n * @example\n * // With an `async` function,\n * async function GetName(): Promise<string> { ... }\n * // Or, with a `Promise`,\n * const GetName: Promise<string> = new Promise<string>(...);\n *\n * // For both of the above cases, `Try` behaves the same:\n * const { Data: Name, Error: NameError } = await Try(GetName);\n * // If `GetName` returned,\n * // `typeof Name` <- `\"string\"`\n * // `typeof NameError` <- `\"undefined\"`\n * // If `GetName` threw,\n * // `typeof Name` <- `\"undefined\"`\n * // `NameError !== undefined` <- `true` (Unless `GetName` threw `undefined`).\n */\nexport async function Try<DataType>(Source: TTrySource<DataType>): Promise<TTryResult<DataType>> {\n try {\n const Data: DataType = typeof Source === \"function\"\n ? await Source()\n : await Source;\n return {\n Data,\n Error: undefined\n };\n }\n catch (ErrorValue: unknown) {\n return {\n Data: undefined,\n Error: ErrorValue\n };\n }\n}\n/**\n * A cleaner way of using `Array.prototype.map` with an `async` function.\n *\n * @template ArgumentElementType - The type of the given {@link Elements}.\n * @template ReturnElementType - The type of the `Array` returned by this.\n *\n * @param Elements - The `Array` that will be transformed.\n * @param Mapper - The function that maps each {@link ArgumentElementType}\n * to a {@link ReturnElementType}.\n *\n * @returns {Array<ReturnElementType>} An `Array` of {@link ReturnElementType}.\n *\n * @example\n * In an `async` function,\n * ```typescript\n * const ArgumentElements: Array<ArgumentElementType> = [ ... ];\n * const ToReturnElement = async (Element: ArgumentElementType): Promise<ReturnElementType> => ...;\n * const ReturnElements: Array<ReturnElementType> = await Map(ArgumentElements, ToReturnElement);\n * ```\n */\nexport async function Map<ArgumentElementType, ReturnElementType>(Elements: Array<ArgumentElementType>, Mapper: ((Element: ArgumentElementType) => Promise<ReturnElementType>)): Promise<Array<ReturnElementType>> {\n const MapperWrapped = async (Element: ArgumentElementType): Promise<ReturnElementType> => {\n return Mapper(Element);\n };\n const Out: Array<Promise<ReturnElementType>> = Elements.map(MapperWrapped);\n return await Promise.all(Out);\n}\n/**\n * An abstract implementation of {@link PromiseLike}. This exists only to maintain the\n * project's naming convention.\n */\nexport abstract class TPromiseLike<ResolveType> implements PromiseLike<ResolveType> {\n public then<ResultType = ResolveType, RejectType = never>(_OnFulfilled?: TOnFulfilled<ResolveType, ResultType>, _OnRejected?: TOnRejected<RejectType>): TPromiseLike<ResultType | RejectType> {\n throw new AbstractMethodCallError(\"TPromiseLike\");\n }\n}\n/**\n * The {@link TypeError} that is thrown by the constructor of {@link TPromise}\n * iff it receives an argument that is not a {@link TPromiseCtorArgument}.\n * It does not provide any additional information (in particular, it does not\n * add any properties, and it does not set any properties inherited from\n * {@link TypeError}).\n *\n * @note While the argument type of {@link TPromise}'s constructor is checked at runtime,\n * the type checker should prevent the error described by this from happening.\n */\nexport class FPromiseInstantiationError extends TypeError {\n public constructor() {\n super();\n }\n}\n/**\n * A `then`-able wrapper of {@link Promise}.\n *\n * @template ResolveType - The type to which this resolves, if it does resolve.\n */\nexport class TPromise<ResolveType> extends TPromiseLike<ResolveType> implements PromiseLike<ResolveType> {\n public constructor(Argument: TPromiseCtorArgument<ResolveType>) {\n super();\n if (typeof Argument === \"function\") {\n this.Underlying = new Promise<ResolveType>(Argument);\n }\n else {\n if (Argument instanceof TPromise) {\n this.Underlying = Argument.Raw();\n }\n else if (Argument instanceof Promise) {\n this.Underlying = Argument;\n }\n }\n throw new FPromiseInstantiationError();\n }\n private readonly Underlying: Promise<ResolveType>;\n /**\n * This class's extension of {@link Promise!then}.\n *\n * @template ResultType - The type to which the value underlying the {@link TPromise} returned by this\n * will resolve, if the {@link TPromise} resolves.\n *\n * @template RejectType - The type to which the value underlying the {@link TPromise} returned by this\n * will reject, if the {@link TPromise} rejects.\n *\n * @param OnFulfilled - The callback that is called when the underlying {@link Promise} resolves,\n * if it resolves.\n *\n * @param OnRejected - The callback that is called when the underlying {@link Promise} rejects,\n * if it rejects.\n *\n * @returns {TPromise<ResultType | RejectType>} A new {@link TPromise} of the result of the\n * given callbacks.\n *\n * @example\n * ```typescript\n * const Example: TPromise<string> = new TPromise<string>((Resolve, Reject) =>\n * {\n * if (Math.random() < 0.5)\n * {\n * Resolve(\"Success\");\n * }\n * else\n * {\n * Reject(\"Error\");\n * }\n * });\n *\n * Example.then(\n * (Value: string): void =>\n * {\n * // `Value` <- `\"Success\"`\n * },\n * (Reason: unknown): void =>\n * {\n * // `Reason` <- `\"Error\"`\n * }\n * );\n * ```\n */\n public Then<ResultType = ResolveType, RejectType = never>(OnFulfilled: TOnFulfilled<ResolveType, ResultType>, OnRejected?: TOnRejected<RejectType>): TPromise<ResultType | RejectType> {\n return new TPromise<ResultType | RejectType>(this.Underlying.then(OnFulfilled, OnRejected));\n }\n public override then<ResultType = ResolveType, RejectType = never>(OnFulfilled?: TOnFulfilled<ResolveType, ResultType>, OnRejected?: TOnRejected<RejectType>): TPromise<ResultType | RejectType> {\n return new TPromise<ResultType | RejectType>(this.Underlying.then(OnFulfilled, OnRejected));\n }\n public Catch<ResultType = never>(OnRejected?: TNullable<TOnRejected<ResolveType>>): TPromiseLike<ResolveType | ResultType> {\n return new TPromise<ResolveType | ResultType>(this.Underlying.catch(OnRejected));\n }\n public Finally(OnFinally?: TNullable<TFunction>): TPromise<ResolveType> {\n return new TPromise(this.Underlying.finally(OnFinally));\n }\n public static Resolve<ResolveType>(Value: ResolveType | PromiseLike<ResolveType>): TPromise<Awaited<ResolveType>> {\n return new TPromise(Promise.resolve(Value));\n }\n public static Reject<ResolveType = unknown>(Reason?: unknown): TPromise<ResolveType> {\n return new TPromise(Promise.reject<ResolveType>(Reason));\n }\n public Raw(): Promise<ResolveType> {\n return this.Underlying;\n }\n}\n;\n", "/**\n * @file Complex.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nimport { MathBuiltin } from \"./Complex.Internal\";\nimport { Operator } from \"tsover-runtime\";\n/**\n * Elements of the complex plane, $\\mathbf{C} = \\mathbf{R}[x] / [ x^2 + 1 ]$.\n */\nexport class FComplex {\n public readonly Re: number;\n public readonly Im: number;\n public static Zero: FComplex = new FComplex(0, 0);\n /**\n * The copy constructor for {@link FComplex} numbers.\n *\n * @param Z - The existing {@link FComplex} number to copy.\n *\n * @example\n * ```typescript\n * const Z: FComplex = 3 + 2 * i;\n * const W: FComplex = new FComplex(Z);\n * // `W.Re === Z.Re` <- `true`\n * // `W.Im === Z.Im` <- `true`\n * ```\n */\n public constructor(Z: FComplex);\n /**\n * Construct an {@link FComplex} number by specifying the real\n * and imaginary components.\n *\n * @param A - The real component of the {@link FComplex} number.\n * @param B - The imaginary component of the {@link FComplex} number.\n *\n * @example\n * ```typescript\n * const Theta: number = 0.5;\n * const OnUnitDisk: FComplex = new FComplex(Math.sin(Theta), Math.cos(Theta));\n * ```\n */\n public constructor(A: number, B: number);\n public constructor(A: FComplex | number, B: number = 0) {\n if (typeof A === \"number\") {\n this.Re = A;\n this.Im = B;\n }\n else {\n this.Re = A.Re;\n this.Im = A.Im;\n }\n }\n /**\n * Get the modulus of this {@link FComplex} number.\n *\n * @returns {number} The modulus of this {@link FComplex} number.\n */\n public get Mod(): number {\n return MathBuiltin.sqrt((this.Re ** 2) + (this.Im ** 2));\n }\n /**\n * Get the modulus of this {@link FComplex} number.\n *\n * @returns {number} The modulus of this {@link FComplex} number.\n */\n public get Theta(): number {\n const Out: number = MathBuiltin.atan2(this.Im, this.Re);\n if (Out < 0) {\n return Out + 2 * MathBuiltin.PI;\n }\n return Out;\n }\n [Operator.star](A: FComplex, B: FComplex): FComplex;\n [Operator.star](A: FComplex, B: number): FComplex;\n [Operator.star](A: number, B: FComplex): FComplex;\n [Operator.star](A: FComplex | number, B: number | FComplex): FComplex {\n if (typeof A === \"number\") {\n return new FComplex((B as FComplex).Re * A, (B as FComplex).Im * A);\n }\n else if (typeof B === \"number\") {\n return new FComplex((A as FComplex).Re * B, (A as FComplex).Im * B);\n }\n else {\n return new FComplex((((A as FComplex).Re + (B as FComplex).Re) -\n ((A as FComplex).Im + (B as FComplex).Im)), (((A as FComplex).Re + (B as FComplex).Im) +\n ((B as FComplex).Re + (A as FComplex).Im)));\n }\n }\n [Operator.plus](A: FComplex, B: FComplex): FComplex;\n [Operator.plus](A: FComplex, B: number): FComplex;\n [Operator.plus](A: number, B: FComplex): FComplex;\n [Operator.plus](A: FComplex | number, B: number | FComplex): FComplex {\n if (typeof A === \"number\") {\n return new FComplex(A + (B as FComplex).Re, (B as FComplex).Im);\n }\n else if (typeof B === \"number\") {\n return new FComplex((A as FComplex).Re + B, (A as FComplex).Im);\n }\n else {\n return new FComplex((A as FComplex).Re + (B as FComplex).Re, (A as FComplex).Im + (B as FComplex).Im);\n }\n }\n}\nexport /**\n * The imaginary unit.\n */ const i: FComplex = new FComplex(0, 1);\n", "/**\n * @file Complex.Internal.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nexport const MathBuiltin: typeof Math = Math;\n", "/**\n * @file index.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nexport * from \"./FileSystem.ts\";\nexport * from \"./FileSystem.Types.ts\";\nexport * as Module from \"./Module/index.ts\";\n", "/**\n * @file FileSystem.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nimport * as FileSystem from \"node:fs/promises\";\nimport * as Path from \"node:path\";\nimport { basename, dirname, extname, join } from \"path\";\nimport { type FFileExtension } from \"./FileSystem.Types.ts\";\nimport { type FileHandle } from \"fs/promises\";\nimport { promises as Fs } from \"fs\";\nimport { constants as FsConstants } from \"fs\";\nimport os from \"os\";\nasync function PathExists(Path: string): Promise<boolean> {\n try {\n await Fs.access(Path, FsConstants.F_OK);\n return true;\n }\n catch {\n return false;\n }\n}\n/**\n * @param Extension - The file extension that you wish to test.\n * @returns Whether the file extension is valid on the current platform.\n */\nexport function IsSupportedFileExtension(Extension: FFileExtension): boolean {\n let NormalizedExtension: string = Extension.slice(1);\n if (NormalizedExtension.startsWith(\".\")) {\n NormalizedExtension = NormalizedExtension.slice(1);\n }\n if (NormalizedExtension.length === 0) {\n return false;\n }\n if (NormalizedExtension.includes(\"/\")\n || NormalizedExtension.includes(\"\\\\\")\n || NormalizedExtension.includes(\"\\0\")) {\n return false;\n }\n if (os.platform() === \"win32\") {\n /* eslint-disable-next-line no-control-regex */\n const HasIllegalCharacters: boolean = /[<>:\"/\\\\|?*\\x00-\\x1F]/u.test(NormalizedExtension);\n if (HasIllegalCharacters) {\n return false;\n }\n if (/[ .]$/u.test(NormalizedExtension)) {\n return false;\n }\n }\n return true;\n}\n/**\n * Given a path at which we wish to create a new file, check if a file at that\n * path already exists, and if so, then append `(${ number })` before the file\n * extension, consistent with the Windows Explorer handles conflicting file\n * names when pasting files.\n */\nexport async function GetSafeNewPath(InPath: string): Promise<string> {\n const DirectoryPath: string = dirname(InPath);\n const Extension: string = extname(InPath);\n const FileName: string = basename(InPath);\n const BaseFileName: string = Extension === \"\"\n ? FileName\n : basename(InPath, Extension);\n let CandidatePath: string = InPath;\n let Index: number = 1;\n while (await PathExists(CandidatePath)) {\n const CandidateFileName: string = `${BaseFileName} (${Index})${Extension}`;\n CandidatePath = join(DirectoryPath, CandidateFileName);\n Index++;\n }\n return CandidatePath;\n}\n/* eslint-disable-next-line @typescript-eslint/typedef */\nexport const ReservedWindowsFileNames = [\n \"CON\",\n \"PRN\",\n \"AUX\",\n \"NUL\",\n \"COM1\",\n \"COM2\",\n \"COM3\",\n \"COM4\",\n \"COM5\",\n \"COM6\",\n \"COM7\",\n \"COM8\",\n \"COM9\",\n \"LPT1\",\n \"LPT2\",\n \"LPT3\",\n \"LPT4\",\n \"LPT5\",\n \"LPT6\",\n \"LPT7\",\n \"LPT8\",\n \"LPT9\",\n] as const;\nexport const InvalidCharacters: RegExp = /[<>:\"/\\\\|?*\\u0000-\\u001F]/u;\n/**\n * @param DirectoryPath - The path to the directory in which you wish to check.\n * @param FileName - The desired file name.\n * @param PersistNewFile - *(Optional)* Whether to keep the otherwise-temporary\n * file created at the desired path.\n * @param Extension - *(Optional)* If provided, the function will only return `true`\n * if `FileName.endsWith(Extension)` *and* the `Extension` is a valid\n * file extension.\n * @returns Whether a file of the given `FileName` can be created in `DirectoryPath`.\n *\n * @remarks This *does* attempt to create a file at the desired path. The file is\n * temporary iff `!PersistNewFile`, and is never created when this function\n * returns `false`.\n */\nexport async function IsValidFileName(DirectoryPath: string, FileName: string, PersistNewFile: boolean = false, Extension: FFileExtension | undefined = undefined): Promise<boolean> {\n const ExtensionSafe: FFileExtension | null | \"\" = Extension !== undefined\n ? (Extension.startsWith(\".\") && IsSupportedFileExtension(Extension))\n ? Extension\n : null\n : \"\";\n const IsExtensionImproper: boolean = (ExtensionSafe === null ||\n ExtensionSafe === \".\" ||\n !FileName.endsWith(ExtensionSafe));\n if (IsExtensionImproper) {\n return false;\n }\n const FilePath: string = join(DirectoryPath, FileName);\n try {\n const ThisFileHandle: FileHandle = await Fs.open(FilePath, \"wx\");\n await ThisFileHandle.close();\n if (!PersistNewFile) {\n await Fs.unlink(FilePath);\n }\n return true;\n }\n catch {\n return false;\n }\n}\n/**\n * Write a text file to a given {@link Path} having contents {@link Contents}.\n *\n * @param Path - The path of the file that will be written.\n * @param Contents - The text contents of the file to write.\n *\n * @returns {Promise<void>} A {@link Promise} that resolves when the call to {@link Fs.writeFile} resolves.\n *\n * @example\n * ```typescript\n * import { WriteTextFile } from \"@sorrell/utilities/fs\";\n * import { resolve } from \"path\";\n *\n * const MyReadMe: string = \"# ReadMe\\n\\nThis package accomplishes...\\n\";\n * const MyReadMePath: string = resolve(\".\");\n *\n * await WriteTextFile(MyReadMePath, MyReadMe);\n * ```\n */\nexport async function WriteTextFile(Path: string, Contents: string): Promise<void> {\n await Fs.writeFile(Path, Contents, { encoding: \"utf-8\" });\n}\ntype DeletePhase = \"Scanning\" | \"Deleting\" | \"Done\";\ntype DeleteEntryKind = \"File\" | \"Directory\" | \"Other\";\ntype DeleteEntry = {\n EntryPath: string;\n Kind: DeleteEntryKind;\n Size: number;\n};\ntype DeleteProgress = {\n Phase: DeletePhase;\n CurrentPath: string | null;\n DiscoveredEntries: number;\n TotalEntries: number;\n DeletedEntries: number;\n TotalBytes: number;\n DeletedBytes: number;\n};\ntype DeleteWithProgressOptions = {\n OnProgress?: (Progress: DeleteProgress) => void;\n Signal?: AbortSignal;\n};\nfunction IsMissingFileError(ErrorValue: unknown): boolean {\n return (typeof ErrorValue === \"object\" &&\n ErrorValue !== null &&\n \"code\" in ErrorValue &&\n ErrorValue.code === \"ENOENT\");\n}\nfunction CloneProgress(Progress: DeleteProgress): DeleteProgress {\n return { ...Progress };\n}\nasync function BuildDeletionPlan(RootPath: string, Progress: DeleteProgress, Options: DeleteWithProgressOptions): Promise<DeleteEntry[]> {\n const Entries: DeleteEntry[] = [];\n async function Visit(CurrentPath: string): Promise<void> {\n Options.Signal?.throwIfAborted();\n Progress.Phase = \"Scanning\";\n Progress.CurrentPath = CurrentPath;\n Options.OnProgress?.(CloneProgress(Progress));\n let Stats;\n try {\n Stats = await FileSystem.lstat(CurrentPath);\n }\n catch (ErrorValue) {\n if (IsMissingFileError(ErrorValue)) {\n return;\n }\n throw ErrorValue;\n }\n if (Stats.isDirectory()) {\n const Children = await FileSystem.readdir(CurrentPath, {\n withFileTypes: true\n });\n for (const Child of Children) {\n await Visit(Path.join(CurrentPath, Child.name));\n }\n Entries.push({\n EntryPath: CurrentPath,\n Kind: \"Directory\",\n Size: 0\n });\n }\n else {\n const Size = Stats.isFile() ? Stats.size : 0;\n Entries.push({\n EntryPath: CurrentPath,\n Kind: Stats.isFile() ? \"File\" : \"Other\",\n Size\n });\n Progress.TotalBytes += Size;\n }\n Progress.DiscoveredEntries = Entries.length;\n Options.OnProgress?.(CloneProgress(Progress));\n }\n await Visit(RootPath);\n return Entries;\n}\nexport async function DeleteWithProgress(RootPath: string, Options: DeleteWithProgressOptions = {}): Promise<void> {\n const Progress: DeleteProgress = {\n Phase: \"Scanning\",\n CurrentPath: null,\n DiscoveredEntries: 0,\n TotalEntries: 0,\n DeletedEntries: 0,\n TotalBytes: 0,\n DeletedBytes: 0\n };\n const Entries = await BuildDeletionPlan(RootPath, Progress, Options);\n Progress.Phase = \"Deleting\";\n Progress.TotalEntries = Entries.length;\n Progress.CurrentPath = null;\n Options.OnProgress?.(CloneProgress(Progress));\n for (const Entry of Entries) {\n Options.Signal?.throwIfAborted();\n Progress.CurrentPath = Entry.EntryPath;\n Options.OnProgress?.(CloneProgress(Progress));\n try {\n if (Entry.Kind === \"Directory\") {\n await FileSystem.rmdir(Entry.EntryPath);\n }\n else {\n await FileSystem.unlink(Entry.EntryPath);\n }\n }\n catch (ErrorValue) {\n if (!IsMissingFileError(ErrorValue)) {\n throw ErrorValue;\n }\n }\n Progress.DeletedEntries += 1;\n Progress.DeletedBytes += Entry.Size;\n Options.OnProgress?.(CloneProgress(Progress));\n }\n Progress.Phase = \"Done\";\n Progress.CurrentPath = null;\n Options.OnProgress?.(CloneProgress(Progress));\n}\nfunction FormatBytes(Bytes: number): string {\n const Units = [\"B\", \"KB\", \"MB\", \"GB\", \"TB\"];\n let Value = Bytes;\n let UnitIndex = 0;\n while (Value >= 1024 && UnitIndex < Units.length - 1) {\n Value /= 1024;\n UnitIndex += 1;\n }\n return `${Value.toFixed(UnitIndex === 0 ? 0 : 1)} ${Units[UnitIndex]}`;\n}\n", "/**\n * @file index.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nexport * from \"./Module.ts\";\nexport * from \"./Module.Types.ts\";\n", "/**\n * @file String.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\n/**\n * @module String\n * Functions for manipulating strings.\n */\n// @TODO TEMPORARY.\n/* eslint-disable jsdoc/require-example */\n/**\n * Does the given {@link TestString} contain only letters?\n * This is equivalent to Python's\n * {@link https://docs.python.org/3/library/stdtypes.html#str.isalpha | isalpha} function.\n *\n * @remarks This is an alias for {@link IsAlpha}.\n *\n * @param TestString - The string that you wish to test.\n *\n * @returns {boolean} Whether the given string contains *only* (Latin alphabet) letters.\n */\nexport function IsLetters(TestString: string): boolean {\n return /^[a-zA-Z]*$/.test(TestString);\n}\n/**\n * Does the given {@link TestString} contain only letters?\n * This is equivalent to Python's\n * {@link https://docs.python.org/3/library/stdtypes.html#str.isalpha | isalpha} function.\n *\n * @param TestString - The string that you wish to test.\n *\n * @returns {boolean} Whether the given string contains *only* (Latin alphabet) letters.\n */\nexport function IsAlpha(TestString: string): boolean {\n return IsLetters(TestString);\n}\n/**\n * Does the given {@link TestString} contain only digits?\n *\n * This is equivalent to Python's\n * {@link https://docs.python.org/3/library/stdtypes.html#str.isnumeric | isnumeric} function.\n *\n * @param TestString - The string that you wish to test.\n *\n * @returns {boolean} Whether the given string contains *only* numeric digits.\n */\nexport function IsNumeric(TestString: string): boolean {\n return /^\\d+$/.test(TestString);\n}\n/**\n * This function provides a convenient way to define long strings across multiple lines.\n * The linebreaks and leading indentation are removed from the final string.\n * Please see the example below for how this is to be done.\n *\n * @param Content - The given string to dedent.\n * @param IndentLength - The number of spaces for which this function will check. This\n * is necessary only if the number of spaces used in the {@link Content} is not a multiple\n * of two.\n *\n * @returns {string} The given {@link Content}, but with the spaces at the beginning\n * of each line (excluding the first line if no spaces exist in the first line) removed.\n *\n * @example\n * ```typescript\n * import { Dedent } from \"@sorrell/utilities/string\";\n *\n * const MyLongString: string = Dedent(`Lorem ipsum dolor sit amet, consectetur adipiscing elit,\n * sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad\n * minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea\n * commodo consequat.`);\n *\n * // `MyLongString` <- `\"Lorem ipsum dolor sit amet, consectetur adipiscing elit, \\\n * sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad \\\n * minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea \\\n * commodo consequat.\"`\n * ```\n */\nexport function Dedent(Content: string, IndentLength?: number): string {\n const WhitespaceSubstring: string = ((): string => {\n if (IndentLength !== undefined) {\n return \"\\n\" + \" \".repeat(IndentLength);\n }\n let WhitespaceSubstring: string = \"\\n\";\n while (true) {\n const TestString: string = WhitespaceSubstring + \" \";\n if (Content.includes(TestString)) {\n WhitespaceSubstring = TestString;\n }\n else {\n break;\n }\n }\n return WhitespaceSubstring;\n })();\n return Content.replaceAll(WhitespaceSubstring, \"\");\n}\nexport function GetUtf8ByteLength(Text: string): number {\n return new TextEncoder().encode(Text).length;\n}\n", "/**\n * @file Module.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nimport { InvalidCharacters, ReservedWindowsFileNames } from \"../FileSystem.ts\";\nimport type { ExtensionPolicy } from \"./Module.Types.ts\";\nimport { GetUtf8ByteLength } from \"../../String/String.ts\";\n/* eslint-disable @typescript-eslint/typedef */\nexport namespace ValidExtensions {\n export /**\n * The valid file extensions for TypeScript *source* modules.\n */ const Source = [\n \".ts\",\n \".tsx\",\n \".mts\",\n \".cts\"\n ] as const;\n export /**\n * The valid file extensions for TypeScript *declaration* modules.\n */ const Declaration = [\n \".d.ts\",\n \".d.mts\",\n \".d.cts\"\n ] as const;\n export /**\n * The valid file extensions for *any* TypeScript module.\n */ const Any = [\n \".ts\",\n \".tsx\",\n \".mts\",\n \".cts\",\n \".d.ts\",\n \".d.mts\",\n \".d.cts\"\n ] as const;\n}\n/* eslint-enable @typescript-eslint/typedef */\nexport function HasTypeScriptExtension(FileName: string): boolean {\n return /\\.(ts|tsx|mts|cts|d\\.ts|d\\.mts|d\\.cts)$/iu.test(FileName);\n}\nexport function IsValidFileName(FileName: string, ExtensionPolicy: ExtensionPolicy = \"Disallow\"): boolean {\n if (FileName.length === 0) {\n return false;\n }\n if (FileName === \".\" || FileName === \"..\") {\n return false;\n }\n const DoesExtensionSatisfyPolicy: boolean = ((ExtensionPolicy === \"Disallow\" && !HasTypeScriptExtension(FileName)) ||\n (ExtensionPolicy === \"Require\" && HasTypeScriptExtension(FileName)) ||\n (Array.isArray(ExtensionPolicy) && ExtensionPolicy.some(FileName.endsWith)));\n if (!DoesExtensionSatisfyPolicy) {\n return false;\n }\n if (FileName.endsWith(\".\") || FileName.endsWith(\" \")) {\n return false;\n }\n if (GetUtf8ByteLength(FileName) > 255) {\n return false;\n }\n if (InvalidCharacters.test(FileName)) {\n return false;\n }\n const FileNameWithoutDots: string | undefined = FileName.split(\".\")[0]?.toUpperCase();\n const FileNameContainsWindowsReserved: boolean = (FileNameWithoutDots !== undefined &&\n (ReservedWindowsFileNames as ReadonlyArray<string>).includes(FileNameWithoutDots));\n if (FileNameContainsWindowsReserved) {\n return false;\n }\n return true;\n}\n", "/**\n * @file index.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nexport * from \"./Functional.ts\";\nexport * from \"./Functional.Types.ts\";\n", "/**\n * @file Functional.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\n/* eslint-disable jsdoc/require-example */\n/**\n * The identity mapping, for some {@link Array} of {@link ArgumentVector | given arguments}.\n *\n * @param ArgumentVector - The {@link Array} of given arguments.\n * @returns {typeof ArgumentVector} The {@link Array} of given arguments.\n */\nexport function Identity<ArgumentType>(...ArgumentVector: Array<ArgumentType>): typeof ArgumentVector {\n return ArgumentVector;\n}\n/* eslint-enable jsdoc/require-example */\n", "/**\n * @file index.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\n/**\n * @module Math\n * Functions, types, and classes for mathematical computations.\n */\nexport * as Complex from \"./Index.Complex.ts\";\nexport * as Vector from \"./Vector.ts\";\nexport * from \"./Math.ts\";\nexport * from \"./Math.Types.ts\";\n", "/**\n * @file Index.Complex.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nexport * from \"./Complex.ts\";\nexport * from \"./Complex.Types.ts\";\n", "/**\n * @file Vector.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nimport { Operator } from \"tsover-runtime\";\n/** A representation of elements in $\\mathbf{R}^2$. */\nexport class FVector2D {\n /** The $x$-component of this vector. */\n public readonly X: number;\n /** The $y$-component of this vector. */\n public readonly Y: number;\n /** The identity of $\\mathbf{R}^2$ *wrt* addition. */\n public static Zero: FVector2D = new FVector2D(0, 0);\n /**\n * Construct a vector by specifying both components.\n *\n * @param Value - The value of both the {@link FVector2D!X | x}- and\n * {@link FVector2D!Y ? y}-components.\n */\n public constructor(Value: number);\n /**\n * Construct a vector by specifying both components.\n *\n * @param X - The value of the {@link FVector2D!X} component.\n * @param Y - The value of the {@link FVector2D!Y} component.\n */\n public constructor(X: number, Y: number);\n public constructor(X: number = 0, Y: number = X) {\n this.X = X;\n this.Y = Y;\n }\n /**\n * Get a representation of this vector as a `string`.\n *\n * @returns {string} The string representation of this vector.\n */\n public toString(): string {\n return `(${this.X}, ${this.Y})`;\n }\n /**\n * Perform per-component addition of two {@link FVector2D}s.\n *\n * @param Left - The left-hand operand.\n * @param Right - The right-hand operand.\n *\n * @returns {FVector2D} The per-component sum of {@link Left} and {@link Right}.\n *\n * @example\n * ```typescript\n * \"use tsover\";\n *\n * const A: FVector2D = new FVector2D(1, -1);\n * const B: FVector2D = new FVector2D(-3, 5);\n *\n * const C: FVector2D = A + B;\n * // `C` <- `(-2, 4)`\n * ```\n */\n [Operator.plus](Left: FVector2D, Right: FVector2D): FVector2D {\n return new FVector2D(Left.X + Right.X, Left.Y + Right.Y);\n }\n [Operator.minus](A: FVector2D, B: FVector2D): FVector2D {\n return new FVector2D(A.X - B.X, A.Y - B.Y);\n }\n [Operator.preMinus](Vector: FVector2D): FVector2D {\n return new FVector2D(-1 * Vector.X, -1 * Vector.Y);\n }\n /**\n * Perform scalar multiplication of an {@link FVector2D} and a `number` value.\n * Exactly one of the two arguments must be a `number`, and the other an\n * {@link FVector2D}.\n *\n * @param Left - The left-hand operand (either a `number` or an {@link FVector2D}).\n * @param Left - The right-hand operand (either a `number` or an {@link FVector2D}).\n *\n * @returns {FVector2D} The per-component sum of {@link Left} and {@link Right}.\n */\n [Operator.star](Left: number, Right: FVector2D): FVector2D;\n [Operator.star](Left: FVector2D, Right: number): FVector2D;\n [Operator.star](Left: FVector2D | number, Right: FVector2D | number): FVector2D | typeof Operator.deferOperation {\n if (typeof Left === \"number\" && Right instanceof FVector2D) {\n return new FVector2D(Left * Right.X, Left * Right.Y);\n }\n if (typeof Right === \"number\" && Left instanceof FVector2D) {\n return new FVector2D(Left.X * Right, Left.Y * Right);\n }\n return Operator.deferOperation;\n }\n public get length(): number {\n return Math.sqrt((this.X ** 2) + (this.Y ** 2));\n }\n public get Length(): number {\n return this.length;\n }\n}\n/** A representation of elements in $\\mathbf{R}^3$. */\nexport class FVector {\n public readonly X: number;\n public readonly Y: number;\n public readonly Z: number;\n /** Constructs the zero {@link FVector}. */\n public constructor();\n /**\n * Constructs an {@link FVector} with all components set to {@link Value}.\n *\n * @param Value - The value of all components of the new {@link FVector}.\n */\n public constructor(Value: number);\n /**\n * Constructs an {@link FVector} with all components set to {@link Value}.\n *\n * @param X - The value of the {@link FVector!X} component.\n * @param Y - The value of the {@link FVector!Y} component.\n * @param Z - The value of the {@link FVector!Z} component.\n */\n public constructor(X: number, Y: number, Z: number);\n public constructor(X: number = 0, Y: number = X, Z: number = X) {\n this.X = X;\n this.Y = Y;\n this.Z = Z;\n }\n [Operator.plus](Left: FVector, Right: FVector): FVector {\n return new FVector(Left.X + Right.X, Left.Y + Right.Y, Left.Z + Right.Z);\n }\n [Operator.minus](A: FVector, B: FVector): FVector {\n return new FVector(A.X - B.X, A.Y - B.Y, A.Z - B.Z);\n }\n [Operator.preMinus](Vector: FVector): FVector {\n return new FVector(-1 * Vector.X, -1 * Vector.Y, -1 * Vector.Z);\n }\n [Operator.star](Left: number, Right: FVector): FVector;\n [Operator.star](Left: FVector, Right: number): FVector;\n [Operator.star](Left: FVector | number, Right: FVector | number): FVector | typeof Operator.deferOperation {\n if (typeof Left === \"number\" && Right instanceof FVector) {\n return new FVector(Left * Right.X, Left * Right.Y, Left * Right.Z);\n }\n if (typeof Right === \"number\" && Left instanceof FVector) {\n return new FVector(Left.X * Right, Left.Y * Right, Left.Z * Right);\n }\n return Operator.deferOperation;\n }\n public get length(): number {\n return Math.sqrt((this.X ** 2) + (this.Y ** 2) + (this.Z ** 2));\n }\n public get Length(): number {\n return this.length;\n }\n}\n", "/**\n * @file Math.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\n/* eslint-disable */\nexport const __DummyExport_Number: \"DummyExport\" = \"DummyExport\" as const;\n", "/**\n * @file index.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nexport * from \"./Utility.Types.ts\";\n", "/**\n * @file index.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\n/**\n * @module Npm\n * Utilities for working with `npm` (NodeJS) packages.\n * Many of these likely work with packages of other NodeJS\n * package managers and adjacent runtimes (*e.g.*, `bun` or `deno`).\n */\nexport * from \"./Npm.ts\";\nexport * from \"./Npm.Error.ts\";\n", "/**\n * @file Npm.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nimport { promises as Fs, constants as FsConstants } from \"fs\";\nimport { PackageJsonParseError, RootDirectoryNotFoundError } from \"./Npm.Error.ts\";\nimport { dirname, join } from \"path\";\nimport type { IPackageJson } from \"package-json-type\";\nimport Process from \"process\";\n/**\n * Get the `package.json` of the Node.js project in which the\n * given path, or the current working directory, resides.\n *\n * @param Path - The given path from which to look for a root directory.\n *\n * @throws {RootDirectoryNotFoundError | PackageJsonParseError} An error\n * describing either failure to identify a root directory, or failing to\n * parse the discovered `package.json`.\n *\n * @returns {Promise<IPackageJson>} The {@link IPackageJson} of {@link Path}\n * if provided, otherwise of `process.cwd()`.\n *\n * @example\n * Suppose `process.cwd() === \"./MyPackage\"`,\n * ```typescript\n * const PackageJson: IPackageJson = await GetPackageJson();\n * // `PackageJson` <- *The parsed `package.json` of `MyPackage`.*\n * ```\n */\nexport async function GetPackageJson(Path?: string): Promise<IPackageJson> {\n const RootDirectory: string = await GetPackageRootDirectory(Path);\n const PackageJsonPath: string = join(RootDirectory, \"package.json\");\n const FileContents: string = await Fs.readFile(PackageJsonPath, \"utf-8\");\n const PackageJson: IPackageJson = await (async (): Promise<IPackageJson> => {\n try {\n return JSON.parse(FileContents) as IPackageJson;\n }\n catch (Cause: unknown) {\n throw new PackageJsonParseError({ Cause, Path: PackageJsonPath });\n }\n })();\n return PackageJson;\n}\n/**\n * Get the root directory of the Node.js project in which the\n * current working directory resides.\n *\n * @param Path - The given path from which to look for a root directory.\n *\n * @throws {RootDirectoryNotFoundError} An error iff the root directory\n * of a NodeJS package could not be found.\n *\n * @returns {Promise<string>} The path to the root directory of the package\n * containing {@link Path} if specified, otherwise containing `process.cwd()`.\n *\n * @example\n * Suppose `process.cwd()` is any one of the following,\n * - `/home/alex/myPackage`,\n * - `/home/alex/myPackage/src/MyModule`,\n * - `/home/alex/myPackage/resource/Images`,\n *\n * then,\n *\n * ```typescript\n * const Root: string = await GetPackageRootDirectory();\n * // `Root` <- `\"/home/alex/myPackage\"`\n * ```\n *\n * @example\n * Suppose `TestPath === \"/home/alex/Documents\"` is *not* a NodeJS package root\n * (of course, neither are `/home/alex` or `/home`). Then,\n *\n * ```typescript\n * const TestPath: string = \"/home/alex/Documents\";\n * let Root: string | undefined = undefined;\n * try\n * {\n * Root = await GetPackageRootDirectory(TestPath);\n * }\n * catch (Error: unknown)\n * {\n * // `Error instanceof RootDirectoryNotFound`\n * }\n *\n * // `Root` <- `undefined`\n * ```\n *\n * @example\n * Suppose `process.cwd() === /home/alex/Downloads`, which is *not* a NodeJS package\n * (of course, neither are `/home/alex` or `/home`). Then,\n *\n * ```typescript\n * let Root: string | undefined = undefined;\n * try\n * {\n * Root = await GetPackageRootDirectory();\n * }\n * catch (Error: unknown)\n * {\n * // `Error instanceof RootDirectoryNotFound`\n * }\n * // `Root` <- `undefined`\n * ```\n */\nexport async function GetPackageRootDirectory(Path?: string): Promise<string> {\n let CurrentDirectory: string = await Fs.realpath(Path ?? Process.cwd());\n while (true) {\n const PackageJsonPath: string = join(CurrentDirectory, \"package.json\");\n const PackageJsonExists: boolean = await (async (): Promise<boolean> => {\n try {\n await Fs.access(PackageJsonPath, FsConstants.F_OK);\n return true;\n }\n catch {\n return false;\n }\n })();\n if (PackageJsonExists) {\n return CurrentDirectory;\n }\n const ParentDirectory: string = dirname(CurrentDirectory);\n if (ParentDirectory === CurrentDirectory) {\n throw new RootDirectoryNotFoundError({ Path });\n }\n CurrentDirectory = ParentDirectory;\n }\n}\n", "/**\n * @file Npm.Error.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nimport { Data } from \"effect\";\n/**\n * An error describing that {@link GetPackageJson} failed to parse the discovered `package.json` file.\n *\n * @property {string | undefined} Path - The `Path` argument passed to the effect returning this error,\n * if one was given.\n * @property {unknown} Cause - The cause of this error.\n */\nexport class PackageJsonParseError extends Data.TaggedError(\"PackageJsonParseError\")<{\n readonly Path: string | undefined;\n readonly Cause: unknown;\n}> {\n}\n/**\n * An error describing that {@link GetPackageRootDirectory} failed.\n *\n * @property {string | undefined} Path - The `Path` argument passed to the effect returning\n * this error, if one was given.\n */\nexport class RootDirectoryNotFoundError extends Data.TaggedError(\"RootDirectoryNotFound\")<{\n readonly Path: string | undefined;\n}> {\n}\n", "/**\n * @file index.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nexport * from \"./Path.ts\";\n", "/**\n * @file Path.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nimport { join } from \"path\";\nimport { Operator } from \"tsover-runtime\";\nexport class FPath {\n public readonly Raw: string;\n public toString(): string {\n return this.Raw;\n }\n public constructor(String: string);\n public constructor(Other: FPath);\n public constructor(Argument: string | FPath) {\n if (typeof Argument === \"string\") {\n this.Raw = Argument;\n }\n else {\n this.Raw = Argument.Raw;\n }\n }\n [Operator.slash](A: FPath, B: FPath): FPath;\n [Operator.slash](A: string, B: FPath): FPath;\n [Operator.slash](A: FPath, B: string): FPath;\n [Operator.slash](A: FPath | string, B: FPath | string): FPath {\n if (typeof A === \"string\") {\n return new FPath(join(A, (B as FPath).Raw));\n }\n else if (typeof B === \"string\") {\n return new FPath(join((A as FPath).Raw, B));\n }\n else {\n return new FPath(join((A as FPath).Raw, (B as FPath).Raw));\n }\n }\n}\n", "/**\n * @file index.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nexport * from \"./Record.ts\";\nexport type { RecordNonNullable as NonNullable } from \"./Record.Meta.ts\";\nexport * from \"./Record.Types.ts\";\n", "/**\n * @file Record.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nimport type { FlatMapper, FromPath, Mapper, Path, Walkable } from \"./Record.Types.ts\";\nimport type { Ref } from \"../Miscellaneous/Utility.Types.ts\";\n// @TODO Write example for `SetPropertyFromPath`.\n/* eslint-disable jsdoc/require-example */\n/**\n * Set a value within a given {@link InRecord | Record} at a given {@link Path} to be a given\n * {@link Value}.\n *\n * @param InRecord - The {@link Record} that holds the value with path {@link Path} to be retrieved\n * by this function.\n * @param Path - The {@link PathType} that describes the property to be retrieved by this.\n * @param Value - The value to be set at the given {@link Path} of the given {@link InRecord | Record}.\n *\n * @throws {Error} An {@link Error} iff the given {@link Path} is an {@link Array}, rather than a\n * `.`-delimited `string`.\n */\nexport function SetPropertyFromPath<RecordType extends Walkable, PathType extends Path<RecordType>>(InRecord: RecordType, Path: PathType, Value: FromPath<RecordType, PathType>): void {\n type FProperty = FromPath<RecordType, PathType>;\n if (Array.isArray(Path)) {\n throw new Error(\"SetPropertyFromPath does not support Array-based paths yet.\");\n }\n const PathSplit: Array<string> = Path.split(\".\");\n const Last: string | undefined = PathSplit.pop();\n if (Last === undefined) {\n return;\n }\n if (PathSplit.length === 0) {\n if (!Array.isArray(Path)) {\n ((InRecord.Ref as Record<string, unknown>)[(Path as string)]) = Value;\n }\n }\n const Recurrence = (In: unknown): unknown | undefined => {\n const NextPropertyNameBase: string | undefined = PathSplit.shift();\n if (NextPropertyNameBase !== undefined) {\n const NextPropertyName: string | number = isNaN(parseInt(NextPropertyNameBase))\n ? NextPropertyNameBase\n : parseInt(NextPropertyNameBase);\n const Out: unknown = (In as Record<string, unknown>)[NextPropertyName] as unknown;\n return Recurrence(Out);\n }\n else {\n return In;\n }\n };\n const PropertyRef: Ref<FProperty> = Recurrence(InRecord) as Ref<FProperty>;\n const LastTyped: string | number = isNaN(parseInt(Last))\n ? Last\n : parseInt(Last);\n (PropertyRef.Ref as Record<string, unknown>)[LastTyped] = Value;\n}\n;\n/* eslint-enable jsdoc/require-example */\n// @TODO Write example for `GetPropertyFromPath`.\n/* eslint-disable jsdoc/require-example */\n/**\n * Get a value within a given {@link InRecord | Record} at a given {@link Path}.\n *\n * @param InRecord - The {@link Record} that holds the value with path {@link Path} to be retrieved\n * by this function.\n * @param Path - The {@link PathType} that describes the property to be retrieved by this.\n *\n * @throws {Error} An {@link Error} iff the given {@link Path} is an {@link Array}, rather than a\n * `.`-delimited `string`.\n *\n * @returns {FromPath<RecordType, PathType>} The value in the {@link InRecord} at the given {@link Path}.\n */\nexport function GetPropertyFromPath<RecordType extends Record<string, unknown>, PathType extends Path<RecordType>>(InRecord: RecordType, Path: PathType): FromPath<RecordType, PathType> {\n if (Array.isArray(Path)) {\n throw new Error(\"GetPropertyFromPath does not support Array-based paths yet.\");\n }\n const PathSplit: Array<string> = Path.split(\".\");\n const Recurrence = (In: unknown, Index: number = 0): unknown => {\n const Key: string | number | undefined = isNaN(parseInt(PathSplit[Index] || \"\"))\n ? PathSplit[Index]\n : parseInt(PathSplit[Index] || \"\");\n if (Key !== undefined) {\n const Next: unknown = (In as Record<string, unknown>)[Key];\n if (Index !== PathSplit.length - 1) {\n return Recurrence(Next, Index + 1);\n }\n else {\n return Next;\n }\n }\n else {\n return undefined;\n }\n };\n return Recurrence(InRecord) as FromPath<RecordType, PathType>;\n}\n;\n/* eslint-enable jsdoc/require-example */\n/**\n * Creates a {@link Ref} of a given {@link Type}. Useful for passing\n * primitives to functions by-reference.\n *\n * @template Type - The type of the value wrapped by the returned {@link Ref}.\n *\n * @returns {Ref<Type>} A {@link Ref} of the given {@link Type}.\n */\nexport function MakeRef<Type>(): Ref<Type> {\n return {\n Ref: undefined\n } as Ref<Type>;\n}\n;\n// @TODO Write example for `MapRecord`.\n/* eslint-disable jsdoc/require-example */\n/**\n * Maps a {@link Record} to an {@link Array}.\n *\n * @param InRecord - The {@link Record} over which this function maps.\n * @param InFunction - The {@link FlatMapTransformer | transformer} that maps\n * the record to an {@link Array}.\n *\n * @returns {Array<ElementType>} An {@link Array} of elements, mapped from the given {@link InRecord}.\n */\nexport function Map<KeyType extends PropertyKey, PropertyType, ElementType>(InRecord: Record<KeyType, PropertyType>, InFunction: Mapper<KeyType, PropertyType, ElementType>): Array<ElementType> {\n return Object.keys(InRecord).map((InKey: string, Index: number): ElementType => {\n const Key: KeyType = InKey as KeyType;\n return InFunction(Key, InRecord[Key], Index);\n });\n}\n;\n/* eslint-enable jsdoc/require-example */\n// @TODO Write example for `FlatMap`.\n/* eslint-disable jsdoc/require-example */\n/**\n * Maps a {@link Record} to an {@link Array}.\n *\n * @param InRecord - The {@link Record} over which this function maps.\n * @param InFunction - The {@link FlatMapTransformer | transformer} that maps\n * the record to an {@link Array}.\n *\n * @returns {Array<ElementType>} An {@link Array} of elements, mapped from the given {@link InRecord}.\n */\nexport function FlatMap<KeyType extends PropertyKey, PropertyType, ElementType>(InRecord: Record<KeyType, PropertyType>, InFunction: FlatMapper<KeyType, PropertyType, ElementType>): Array<ElementType> {\n return Object.keys(InRecord).flatMap((InKey: string, Index: number): Array<ElementType> => {\n const Key: KeyType = InKey as KeyType;\n const Transform: ElementType | Array<ElementType> = InFunction(Key, InRecord[Key], Index);\n return Array.isArray(Transform)\n ? Transform\n : [Transform];\n });\n}\n/* eslint-enable jsdoc/require-example */\n", "/**\n * @file index.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nexport * from \"./String.ts\";\n", "/**\n * @file index.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nexport * from \"./TsConfig.Types.ts\";\n", "/**\n * @file index.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nexport * from \"./Tuple.Types.ts\";\n", "/**\n * @file index.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nexport * from \"./Test.Types.ts\";\nexport * from \"./Utility.Types.ts\";\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;;;ACgCO,SAAS,cAAuGA,QAAuH;AAC1O,SAAOA,OAAM,OAAO,CAAC,YAA8C;AAC/D,WAAO,YAAY;AAAA,EACvB,CAAC;AACL;;;ACpCA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACqBO,IAAM,0BAAN,cAAsC,MAAM;AAAA,EACxC,YAAY,WAAoB;AACnC,UAAM,SAAS;AAAA,EACnB;AACJ;;;ACiBA,eAAsB,IAAc,QAA6D;AAC7F,MAAI;AACA,UAAMC,QAAiB,OAAO,WAAW,aACnC,MAAM,OAAO,IACb,MAAM;AACZ,WAAO;AAAA,MACH,MAAAA;AAAA,MACA,OAAO;AAAA,IACX;AAAA,EACJ,SACO,YAAqB;AACxB,WAA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,YAA2BA,MAAK,MAAM,GAAG;AAC/C,QAAM,aAAa,CAAC,IAAa,QAAgB,MAAe;AAC5D,UAAM,MAAmC,MAAM,SAAS,UAAU,KAAK,KAAK,EAAE,CAAC,IACzE,UAAU,KAAK,IACf,SAAS,UAAU,KAAK,KAAK,EAAE;AACrC,QAAI,QAAQ,QAAW;AACnB,YAAM,OAAiB,GAA+B,GAAG;AACzD,UAAI,UAAU,UAAU,SAAS,GAAG;AAChC,eAAO,WAAW,MAAM,QAAQ,CAAC;AAAA,MACrC,OACK;AACD,eAAO;AAAA,MACX;AAAA,IACJ,OACK;AACD,aAAO;AAAA,IACX;AAAA,EACJ;AACA,SAAO,WAAW,QAAQ;AAC9B;AAWO,SAAS,UAA2B;AACvC,SAAO;AAAA,IACH,KAAK;AAAA,EACT;AACJ;AAaO,SAASC,KAA4D,UAAyC,YAA4E;AAC7L,SAAO,OAAO,KAAK,QAAQ,EAAE,IAAI,CAAC,OAAe,UAA+B;AAC5E,UAAM,MAAe;AACrB,WAAO,WAAW,KAAK,SAAS,GAAG,GAAG,KAAK;AAAA,EAC/C,CAAC;AACL;AAcO,SAAS,QAAgE,UAAyC,YAAgF;AACrM,SAAO,OAAO,KAAK,QAAQ,EAAE,QAAQ,CAAC,OAAe,UAAsC;AACvF,UAAM,MAAe;AACrB,UAAM,YAA8C,WAAW,KAAK,SAAS,GAAG,GAAG,KAAK;AACxF,WAAO,MAAM,QAAQ,SAAS,IACxB,YACA,CAAC,SAAS;AAAA,EACpB,CAAC;AACL;;;ACtJA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;;;ACAA;;;ACAA;",
6
+ "names": ["Array", "Data", "import_fs", "Path", "Fs", "FsConstants", "os", "IsValidFileName", "WhitespaceSubstring", "ValidExtensions", "IsValidFileName", "import_tsover_runtime", "import_fs", "import_path", "Path", "Fs", "Process", "FsConstants", "import_path", "import_tsover_runtime", "Map", "Path", "Path", "Map"]
7
7
  }
@@ -222,18 +222,21 @@ var FileSystem_exports = {};
222
222
  __export(FileSystem_exports, {
223
223
  DeleteWithProgress: () => DeleteWithProgress,
224
224
  GetSafeNewPath: () => GetSafeNewPath,
225
+ InvalidCharacters: () => InvalidCharacters,
225
226
  IsSupportedFileExtension: () => IsSupportedFileExtension,
226
227
  IsValidFileName: () => IsValidFileName,
228
+ Module: () => Module_exports,
229
+ ReservedWindowsFileNames: () => ReservedWindowsFileNames,
227
230
  WriteTextFile: () => WriteTextFile
228
231
  });
229
232
 
230
233
  // Source/FileSystem/FileSystem.ts
231
- import { basename, dirname, extname, join } from "path";
234
+ import * as FileSystem from "node:fs/promises";
235
+ import * as Path from "node:path";
236
+ import { basename, dirname, extname, join as join2 } from "path";
232
237
  import { promises as Fs } from "fs";
233
238
  import { constants as FsConstants } from "fs";
234
239
  import os from "os";
235
- import * as FileSystem from "node:fs/promises";
236
- import * as Path from "node:path";
237
240
  async function PathExists(Path2) {
238
241
  try {
239
242
  await Fs.access(Path2, FsConstants.F_OK);
@@ -273,18 +276,43 @@ async function GetSafeNewPath(InPath) {
273
276
  let Index = 1;
274
277
  while (await PathExists(CandidatePath)) {
275
278
  const CandidateFileName = `${BaseFileName} (${Index})${Extension}`;
276
- CandidatePath = join(DirectoryPath, CandidateFileName);
279
+ CandidatePath = join2(DirectoryPath, CandidateFileName);
277
280
  Index++;
278
281
  }
279
282
  return CandidatePath;
280
283
  }
284
+ var ReservedWindowsFileNames = [
285
+ "CON",
286
+ "PRN",
287
+ "AUX",
288
+ "NUL",
289
+ "COM1",
290
+ "COM2",
291
+ "COM3",
292
+ "COM4",
293
+ "COM5",
294
+ "COM6",
295
+ "COM7",
296
+ "COM8",
297
+ "COM9",
298
+ "LPT1",
299
+ "LPT2",
300
+ "LPT3",
301
+ "LPT4",
302
+ "LPT5",
303
+ "LPT6",
304
+ "LPT7",
305
+ "LPT8",
306
+ "LPT9"
307
+ ];
308
+ var InvalidCharacters = /[<>:"/\\|?*\u0000-\u001F]/u;
281
309
  async function IsValidFileName(DirectoryPath, FileName, PersistNewFile = false, Extension = void 0) {
282
310
  const ExtensionSafe = Extension !== void 0 ? Extension.startsWith(".") && IsSupportedFileExtension(Extension) ? Extension : null : "";
283
311
  const IsExtensionImproper = ExtensionSafe === null || ExtensionSafe === "." || !FileName.endsWith(ExtensionSafe);
284
312
  if (IsExtensionImproper) {
285
313
  return false;
286
314
  }
287
- const FilePath = join(DirectoryPath, FileName);
315
+ const FilePath = join2(DirectoryPath, FileName);
288
316
  try {
289
317
  const ThisFileHandle = await Fs.open(FilePath, "wx");
290
318
  await ThisFileHandle.close();
@@ -387,6 +415,101 @@ async function DeleteWithProgress(RootPath, Options = {}) {
387
415
  Options.OnProgress?.(CloneProgress(Progress));
388
416
  }
389
417
 
418
+ // Source/FileSystem/Module/index.ts
419
+ var Module_exports = {};
420
+ __export(Module_exports, {
421
+ HasTypeScriptExtension: () => HasTypeScriptExtension,
422
+ IsValidFileName: () => IsValidFileName2,
423
+ ValidExtensions: () => ValidExtensions
424
+ });
425
+
426
+ // Source/String/String.ts
427
+ function IsLetters(TestString) {
428
+ return /^[a-zA-Z]*$/.test(TestString);
429
+ }
430
+ function IsAlpha(TestString) {
431
+ return IsLetters(TestString);
432
+ }
433
+ function IsNumeric(TestString) {
434
+ return /^\d+$/.test(TestString);
435
+ }
436
+ function Dedent(Content, IndentLength) {
437
+ const WhitespaceSubstring = (() => {
438
+ if (IndentLength !== void 0) {
439
+ return "\n" + " ".repeat(IndentLength);
440
+ }
441
+ let WhitespaceSubstring2 = "\n";
442
+ while (true) {
443
+ const TestString = WhitespaceSubstring2 + " ";
444
+ if (Content.includes(TestString)) {
445
+ WhitespaceSubstring2 = TestString;
446
+ } else {
447
+ break;
448
+ }
449
+ }
450
+ return WhitespaceSubstring2;
451
+ })();
452
+ return Content.replaceAll(WhitespaceSubstring, "");
453
+ }
454
+ function GetUtf8ByteLength(Text) {
455
+ return new TextEncoder().encode(Text).length;
456
+ }
457
+
458
+ // Source/FileSystem/Module/Module.ts
459
+ var ValidExtensions;
460
+ ((ValidExtensions2) => {
461
+ ValidExtensions2.Source = [
462
+ ".ts",
463
+ ".tsx",
464
+ ".mts",
465
+ ".cts"
466
+ ];
467
+ ValidExtensions2.Declaration = [
468
+ ".d.ts",
469
+ ".d.mts",
470
+ ".d.cts"
471
+ ];
472
+ ValidExtensions2.Any = [
473
+ ".ts",
474
+ ".tsx",
475
+ ".mts",
476
+ ".cts",
477
+ ".d.ts",
478
+ ".d.mts",
479
+ ".d.cts"
480
+ ];
481
+ })(ValidExtensions || (ValidExtensions = {}));
482
+ function HasTypeScriptExtension(FileName) {
483
+ return /\.(ts|tsx|mts|cts|d\.ts|d\.mts|d\.cts)$/iu.test(FileName);
484
+ }
485
+ function IsValidFileName2(FileName, ExtensionPolicy = "Disallow") {
486
+ if (FileName.length === 0) {
487
+ return false;
488
+ }
489
+ if (FileName === "." || FileName === "..") {
490
+ return false;
491
+ }
492
+ const DoesExtensionSatisfyPolicy = ExtensionPolicy === "Disallow" && !HasTypeScriptExtension(FileName) || ExtensionPolicy === "Require" && HasTypeScriptExtension(FileName) || Array.isArray(ExtensionPolicy) && ExtensionPolicy.some(FileName.endsWith);
493
+ if (!DoesExtensionSatisfyPolicy) {
494
+ return false;
495
+ }
496
+ if (FileName.endsWith(".") || FileName.endsWith(" ")) {
497
+ return false;
498
+ }
499
+ if (GetUtf8ByteLength(FileName) > 255) {
500
+ return false;
501
+ }
502
+ if (InvalidCharacters.test(FileName)) {
503
+ return false;
504
+ }
505
+ const FileNameWithoutDots = FileName.split(".")[0]?.toUpperCase();
506
+ const FileNameContainsWindowsReserved = FileNameWithoutDots !== void 0 && ReservedWindowsFileNames.includes(FileNameWithoutDots);
507
+ if (FileNameContainsWindowsReserved) {
508
+ return false;
509
+ }
510
+ return true;
511
+ }
512
+
390
513
  // Source/Functional/index.ts
391
514
  var Functional_exports = {};
392
515
  __export(Functional_exports, {
@@ -700,40 +823,12 @@ function FlatMap(InRecord, InFunction) {
700
823
  var String_exports = {};
701
824
  __export(String_exports, {
702
825
  Dedent: () => Dedent,
826
+ GetUtf8ByteLength: () => GetUtf8ByteLength,
703
827
  IsAlpha: () => IsAlpha,
704
828
  IsLetters: () => IsLetters,
705
829
  IsNumeric: () => IsNumeric
706
830
  });
707
831
 
708
- // Source/String/String.ts
709
- function IsLetters(TestString) {
710
- return /^[a-zA-Z]*$/.test(TestString);
711
- }
712
- function IsAlpha(TestString) {
713
- return IsLetters(TestString);
714
- }
715
- function IsNumeric(TestString) {
716
- return /^\d+$/.test(TestString);
717
- }
718
- function Dedent(Content, IndentLength) {
719
- const WhitespaceSubstring = (() => {
720
- if (IndentLength !== void 0) {
721
- return "\n" + " ".repeat(IndentLength);
722
- }
723
- let WhitespaceSubstring2 = "\n";
724
- while (true) {
725
- const TestString = WhitespaceSubstring2 + " ";
726
- if (Content.includes(TestString)) {
727
- WhitespaceSubstring2 = TestString;
728
- } else {
729
- break;
730
- }
731
- }
732
- return WhitespaceSubstring2;
733
- })();
734
- return Content.replaceAll(WhitespaceSubstring, "");
735
- }
736
-
737
832
  // Source/TsConfig/index.ts
738
833
  var TsConfig_exports = {};
739
834
 
@@ -818,6 +913,24 @@ export {
818
913
  * @copyright (c) 2026 Gage Sorrell
819
914
  * @license MIT
820
915
  */
916
+ /**
917
+ * @file String.ts
918
+ * @author Gage Sorrell <gage@sorrell.sh>
919
+ * @copyright (c) 2026 Gage Sorrell
920
+ * @license MIT
921
+ */
922
+ /**
923
+ * @file Module.ts
924
+ * @author Gage Sorrell <gage@sorrell.sh>
925
+ * @copyright (c) 2026 Gage Sorrell
926
+ * @license MIT
927
+ */
928
+ /**
929
+ * @file Module.Types.ts
930
+ * @author Gage Sorrell <gage@sorrell.sh>
931
+ * @copyright (c) 2026 Gage Sorrell
932
+ * @license MIT
933
+ */
821
934
  /**
822
935
  * @file Functional.ts
823
936
  * @author Gage Sorrell <gage@sorrell.sh>
@@ -890,12 +1003,6 @@ export {
890
1003
  * @copyright (c) 2026 Gage Sorrell
891
1004
  * @license MIT
892
1005
  */
893
- /**
894
- * @file String.ts
895
- * @author Gage Sorrell <gage@sorrell.sh>
896
- * @copyright (c) 2026 Gage Sorrell
897
- * @license MIT
898
- */
899
1006
  /**
900
1007
  * @file TsConfig.Types.ts
901
1008
  * @author Gage Sorrell <gage@sorrell.sh>