@sorrell/utilities 1.2.9 → 1.2.12

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 (127) hide show
  1. package/Distribution/PackageExports.Generated.json +30 -0
  2. package/Distribution/Types/Async/Async.Types.d.cts +1 -1
  3. package/Distribution/Types/Async/Async.Types.d.cts.map +1 -1
  4. package/Distribution/Types/Async/Async.Types.d.mts +1 -1
  5. package/Distribution/Types/Async/Async.Types.d.mts.map +1 -1
  6. package/Distribution/Types/Async/Async.Types.d.ts +1 -1
  7. package/Distribution/Types/Async/Async.Types.d.ts.map +1 -1
  8. package/Distribution/Types/Effect/Effect.Types.d.cts +29 -2
  9. package/Distribution/Types/Effect/Effect.Types.d.cts.map +1 -1
  10. package/Distribution/Types/Effect/Effect.Types.d.mts +29 -2
  11. package/Distribution/Types/Effect/Effect.Types.d.mts.map +1 -1
  12. package/Distribution/Types/Effect/Effect.Types.d.ts +29 -2
  13. package/Distribution/Types/Effect/Effect.Types.d.ts.map +1 -1
  14. package/Distribution/Types/Effect/index.d.cts +2 -1
  15. package/Distribution/Types/Effect/index.d.cts.map +1 -1
  16. package/Distribution/Types/Effect/index.d.mts +2 -1
  17. package/Distribution/Types/Effect/index.d.mts.map +1 -1
  18. package/Distribution/Types/Effect/index.d.ts +2 -1
  19. package/Distribution/Types/Effect/index.d.ts.map +1 -1
  20. package/Distribution/Types/FileSystem/FileSystem.d.cts +16 -0
  21. package/Distribution/Types/FileSystem/FileSystem.d.cts.map +1 -1
  22. package/Distribution/Types/FileSystem/FileSystem.d.mts +16 -0
  23. package/Distribution/Types/FileSystem/FileSystem.d.mts.map +1 -1
  24. package/Distribution/Types/FileSystem/FileSystem.d.ts +16 -0
  25. package/Distribution/Types/FileSystem/FileSystem.d.ts.map +1 -1
  26. package/Distribution/Types/Functional/Functional.Types.d.cts +3 -3
  27. package/Distribution/Types/Functional/Functional.Types.d.cts.map +1 -1
  28. package/Distribution/Types/Functional/Functional.Types.d.mts +3 -3
  29. package/Distribution/Types/Functional/Functional.Types.d.mts.map +1 -1
  30. package/Distribution/Types/Functional/Functional.Types.d.ts +3 -3
  31. package/Distribution/Types/Functional/Functional.Types.d.ts.map +1 -1
  32. package/Distribution/Types/Functional/Functional.d.cts +7 -1
  33. package/Distribution/Types/Functional/Functional.d.cts.map +1 -1
  34. package/Distribution/Types/Functional/Functional.d.mts +7 -1
  35. package/Distribution/Types/Functional/Functional.d.mts.map +1 -1
  36. package/Distribution/Types/Functional/Functional.d.ts +7 -1
  37. package/Distribution/Types/Functional/Functional.d.ts.map +1 -1
  38. package/Distribution/Types/HigherKind/HigherKind.Internal.Types.d.cts +30 -0
  39. package/Distribution/Types/HigherKind/HigherKind.Internal.Types.d.cts.map +10 -0
  40. package/Distribution/Types/HigherKind/HigherKind.Internal.Types.d.mts +30 -0
  41. package/Distribution/Types/HigherKind/HigherKind.Internal.Types.d.mts.map +10 -0
  42. package/Distribution/Types/HigherKind/HigherKind.Internal.Types.d.ts +30 -0
  43. package/Distribution/Types/HigherKind/HigherKind.Internal.Types.d.ts.map +1 -0
  44. package/Distribution/Types/HigherKind/HigherKind.Registrar.Types.d.cts +31 -0
  45. package/Distribution/Types/HigherKind/HigherKind.Registrar.Types.d.cts.map +10 -0
  46. package/Distribution/Types/HigherKind/HigherKind.Registrar.Types.d.mts +31 -0
  47. package/Distribution/Types/HigherKind/HigherKind.Registrar.Types.d.mts.map +10 -0
  48. package/Distribution/Types/HigherKind/HigherKind.Registrar.Types.d.ts +31 -0
  49. package/Distribution/Types/HigherKind/HigherKind.Registrar.Types.d.ts.map +1 -0
  50. package/Distribution/Types/HigherKind/HigherKind.Types.d.cts +85 -0
  51. package/Distribution/Types/HigherKind/HigherKind.Types.d.cts.map +10 -0
  52. package/Distribution/Types/HigherKind/HigherKind.Types.d.mts +85 -0
  53. package/Distribution/Types/HigherKind/HigherKind.Types.d.mts.map +10 -0
  54. package/Distribution/Types/HigherKind/HigherKind.Types.d.ts +85 -0
  55. package/Distribution/Types/HigherKind/HigherKind.Types.d.ts.map +1 -0
  56. package/Distribution/Types/{Effect/Effect.d.ts → HigherKind/index.d.cts} +3 -3
  57. package/Distribution/Types/HigherKind/index.d.cts.map +10 -0
  58. package/Distribution/Types/{Effect/Effect.d.cts → HigherKind/index.d.mts} +3 -3
  59. package/Distribution/Types/HigherKind/index.d.mts.map +10 -0
  60. package/Distribution/Types/{Effect/Effect.d.mts → HigherKind/index.d.ts} +3 -3
  61. package/Distribution/Types/HigherKind/index.d.ts.map +1 -0
  62. package/Distribution/Types/Miscellaneous/Utility.Types.d.cts +12 -26
  63. package/Distribution/Types/Miscellaneous/Utility.Types.d.cts.map +1 -1
  64. package/Distribution/Types/Miscellaneous/Utility.Types.d.mts +12 -26
  65. package/Distribution/Types/Miscellaneous/Utility.Types.d.mts.map +1 -1
  66. package/Distribution/Types/Miscellaneous/Utility.Types.d.ts +12 -26
  67. package/Distribution/Types/Miscellaneous/Utility.Types.d.ts.map +1 -1
  68. package/Distribution/Types/TsConfig/TsConfig.Types.d.cts +32 -0
  69. package/Distribution/Types/TsConfig/TsConfig.Types.d.cts.map +10 -0
  70. package/Distribution/Types/TsConfig/TsConfig.Types.d.mts +32 -0
  71. package/Distribution/Types/TsConfig/TsConfig.Types.d.mts.map +10 -0
  72. package/Distribution/Types/TsConfig/TsConfig.Types.d.ts +32 -0
  73. package/Distribution/Types/TsConfig/TsConfig.Types.d.ts.map +1 -0
  74. package/Distribution/Types/TsConfig/index.d.cts +8 -0
  75. package/Distribution/Types/TsConfig/index.d.cts.map +10 -0
  76. package/Distribution/Types/TsConfig/index.d.mts +8 -0
  77. package/Distribution/Types/TsConfig/index.d.mts.map +10 -0
  78. package/Distribution/Types/TsConfig/index.d.ts +8 -0
  79. package/Distribution/Types/TsConfig/index.d.ts.map +1 -0
  80. package/Distribution/Types/index.d.cts +1 -0
  81. package/Distribution/Types/index.d.cts.map +1 -1
  82. package/Distribution/Types/index.d.mts +1 -0
  83. package/Distribution/Types/index.d.mts.map +1 -1
  84. package/Distribution/Types/index.d.ts +1 -0
  85. package/Distribution/Types/index.d.ts.map +1 -1
  86. package/Distribution/async.cjs.map +2 -2
  87. package/Distribution/async.js.map +2 -2
  88. package/Distribution/effect.cjs +4 -24
  89. package/Distribution/effect.cjs.map +3 -3
  90. package/Distribution/effect.js +5 -42
  91. package/Distribution/effect.js.map +3 -3
  92. package/Distribution/fs.cjs +94 -4
  93. package/Distribution/fs.cjs.map +3 -3
  94. package/Distribution/fs.js +94 -4
  95. package/Distribution/fs.js.map +3 -3
  96. package/Distribution/functional.cjs +2 -2
  97. package/Distribution/functional.cjs.map +2 -2
  98. package/Distribution/functional.js +2 -2
  99. package/Distribution/functional.js.map +2 -2
  100. package/Distribution/higher-kind.cjs +31 -0
  101. package/Distribution/higher-kind.cjs.map +7 -0
  102. package/Distribution/higher-kind.js +13 -0
  103. package/Distribution/higher-kind.js.map +7 -0
  104. package/Distribution/index.cjs +112 -12
  105. package/Distribution/index.cjs.map +4 -4
  106. package/Distribution/index.js +119 -19
  107. package/Distribution/index.js.map +4 -4
  108. package/Distribution/misc.cjs.map +2 -2
  109. package/Distribution/misc.js.map +2 -2
  110. package/Distribution/string.cjs +70 -0
  111. package/Distribution/string.cjs.map +7 -0
  112. package/Distribution/string.js +47 -0
  113. package/Distribution/string.js.map +7 -0
  114. package/Distribution/tsconfig.cjs +31 -0
  115. package/Distribution/tsconfig.cjs.map +7 -0
  116. package/Distribution/tsconfig.js +13 -0
  117. package/Distribution/tsconfig.js.map +7 -0
  118. package/package.json +45 -7
  119. package/Distribution/Types/Effect/Effect.d.cts.map +0 -10
  120. package/Distribution/Types/Effect/Effect.d.mts.map +0 -10
  121. package/Distribution/Types/Effect/Effect.d.ts.map +0 -1
  122. package/Distribution/Types/Effect/Index.Effect.d.cts +0 -10
  123. package/Distribution/Types/Effect/Index.Effect.d.cts.map +0 -10
  124. package/Distribution/Types/Effect/Index.Effect.d.mts +0 -10
  125. package/Distribution/Types/Effect/Index.Effect.d.mts.map +0 -10
  126. package/Distribution/Types/Effect/Index.Effect.d.ts +0 -10
  127. package/Distribution/Types/Effect/Index.Effect.d.ts.map +0 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../Source/Miscellaneous/Utility.Types.ts", "../Source/Async/Async.ts"],
4
- "sourcesContent": ["/**\n * @file Utility.Types.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nimport type { NoOptions } from \"./Utility.Internal.ts\";\nimport type TypeScript from \"typescript\";\n/**\n * @deprecated Use {@link TMutable} instead.\n *\n * Defines a type that corresponds to {@link RecordLike}, such that every\n * `readonly` modifier is removed, recursively.\n *\n * @template RecordLike - The type to make writeable.\n */\nexport type TDeepWriteable<RecordLike> = {\n -readonly [Key in keyof RecordLike]: TDeepWriteable<RecordLike[Key]>;\n};\n/**\n * Defines a type that corresponds to {@link RecordLike}, such that every\n * `readonly` modifier is removed, recursively.\n *\n * @template RecordLike - The type to make writeable.\n * @template ShallowOption - Whether the `readonly` modifier should be stripped recursively.\n * If `true` (the default), then only the properties of the given type will have the `readonly`\n * modifier stripped (that is, if any of these properties is a {@link Record} type with `readonly`\n * modifiers, then those will *not* be removed if {@link ShallowOption} is `true`).\n */\nexport type TMutable<RecordLike, ShallowOption extends boolean = true> = ShallowOption extends false ? {\n -readonly [Key in keyof RecordLike]: RecordLike[Key];\n} : ShallowOption extends true ? {\n -readonly [Key in keyof RecordLike]: TMutable<RecordLike[Key]>;\n} : never;\n/**\n * Given a {@link RecordLike | record-like type}, this type is the union\n * of the values of all properties in the {@link RecordLike | record-like type}.\n *\n * @template RecordLike - The record-like type from which this type extracts value types.\n */\nexport type TValues<RecordLike> = RecordLike[keyof RecordLike];\n/**\n * The element type of the return value of `Object.entries()`.\n *\n * @template RecordLike - The record-like type of the argument of `Object.entries()`.\n * @template KeyType - The subset of keys used by this type.\n */\nexport type TEntry<RecordLike, KeyType extends keyof RecordLike = keyof RecordLike> = [\n KeyType,\n RecordLike[KeyType]\n];\n/** The type used in `OptionsType`s when no options are specified. */\nexport type NoOptions = typeof NoOptions;\n/**\n * Define options for a given type as a union of `unique symbol` types.\n * All options must be *optional* by the type that uses these options.\n * The type that uses these options should have a type parameter `OptionsType`\n * defined with `OptionsType extends TOptions = NoOptions`. You will have to import\n * {@link NoOptions}, but this should be done anyway, since making all options types\n * optional should be optional. For this reason {@link NoOptions} is exported from the\n * same module as this type.\n *\n * @template OptionsType - The `unique symbol` types that act as options.\n *\n * @example * See the {@link Array.Options:type} type as an example.\n */\nexport type TOptions<OptionsType extends symbol = NoOptions> = OptionsType | NoOptions;\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/** The type corresponding to the schema of `tsconfig.json`. */\nexport interface FTsConfig {\n extends?: string | Array<string>;\n files?: Array<string>;\n include?: Array<string>;\n exclude?: Array<string>;\n references?: Array<TypeScript.ProjectReference>;\n compilerOptions?: FCompilerOptions;\n watchOptions?: TypeScript.WatchOptions;\n typeAcquisition?: TypeScript.TypeAcquisition;\n compileOnSave?: boolean;\n}\ntype FOverriddenCompilerOptions = \"jsx\" | \"lib\" | \"module\" | \"moduleResolution\" | \"target\";\ntype FCompilerOptions = Omit<TypeScript.server.protocol.CompilerOptions, FOverriddenCompilerOptions> & Partial<{\n jsx: JsxEmit;\n lib: Array<string>;\n module: FModuleKind;\n moduleResolution: FModuleResolutionKind;\n target: FTarget;\n}>;\ntype JsxEmit = \"none\" | \"preserve\" | \"react-native\" | \"react\" | \"react-jsx\" | \"react-jsxdev\";\ntype FModuleKind = \"none\" | \"commonjs\" | \"amd\" | \"umd\" | \"system\" | \"es6\" | \"es2015\" | \"es2020\" | \"es2022\" | \"esnext\" | \"node16\" | \"node18\" | \"node20\" | \"nodenext\" | \"preserve\";\ntype FModuleResolutionKind = \"classic\" | \"node\" | \"node\" | \"node10\" | \"node16\" | \"nodenext\" | \"bundler\";\ntype FTarget = \"es3\" | \"es5\" | \"es6\" | \"es2015\" | \"es2016\" | \"es2017\" | \"es2018\" | \"es2019\" | \"es2020\" | \"es2021\" | \"es2022\" | \"es2023\" | \"es2024\" | \"es2025\" | \"esnext\" | \"json\" | \"esnext\" | \"es2025\";\n/**\n * Maps a given {@link RecordLike} type to an identical {@link Record} type, but\n * the properties are wrapped with {@link NonNullable}.\n *\n * @template RecordLike - The `Record`-like type from which this type is defined.\n */\nexport type TRecordNonNullable<RecordLike> = {\n [Key in keyof RecordLike]: NonNullable<RecordLike[Key]>;\n};\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"],
5
- "mappings": ";AA0EO,IAAM,0BAAN,cAAsC,MAAM;AAAA,EACxC,YAAY,WAAoB;AACnC,UAAM,SAAS;AAAA,EACnB;AACJ;;;ACpCA,eAAsB,IAAc,QAA6D;AAC7F,MAAI;AACA,UAAM,OAAiB,OAAO,WAAW,aACnC,MAAM,OAAO,IACb,MAAM;AACZ,WAAO;AAAA,MACH;AAAA,MACA,OAAO;AAAA,IACX;AAAA,EACJ,SACO,YAAqB;AACxB,WAAO;AAAA,MACH,MAAM;AAAA,MACN,OAAO;AAAA,IACX;A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F;AACvH,WAAO,IAAI,UAAmC,KAAK,WAAW,MAAM,UAAU,CAAC;AAAA,EACnF;AAAA,EACO,QAAQ,WAAyD;AACpE,WAAO,IAAI,UAAS,KAAK,WAAW,QAAQ,SAAS,CAAC;AAAA,EAC1D;AAAA,EACA,OAAc,QAAqB,OAA+E;AAC9G,WAAO,IAAI,UAAS,QAAQ,QAAQ,KAAK,CAAC;AAAA,EAC9C;AAAA,EACA,OAAc,OAA8B,QAAyC;AACjF,WAAO,IAAI,UAAS,QAAQ,OAAoB,MAAM,CAAC;AAAA,EAC3D;AAAA,EACO,MAA4B;AAC/B,WAAO,KAAK;AAAA,EAChB;AACJ;",
4
+ "sourcesContent": ["/**\n * @file Utility.Types.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nimport type { NoOptions } from \"./Utility.Internal.ts\";\n/**\n * @deprecated Use {@link TMutable} instead.\n *\n * Defines a type that corresponds to {@link RecordLike}, such that every\n * `readonly` modifier is removed, recursively.\n *\n * @template RecordLike - The type to make writeable.\n */\nexport type TDeepWriteable<RecordLike> = {\n -readonly [Key in keyof RecordLike]: TDeepWriteable<RecordLike[Key]>;\n};\n/**\n * Defines a type that corresponds to {@link RecordLike}, such that every\n * `readonly` modifier is removed, recursively.\n *\n * @template RecordLike - The type to make writeable.\n * @template ShallowOption - Whether the `readonly` modifier should be stripped recursively.\n * If `true` (the default), then only the properties of the given type will have the `readonly`\n * modifier stripped (that is, if any of these properties is a {@link Record} type with `readonly`\n * modifiers, then those will *not* be removed if {@link ShallowOption} is `true`).\n */\nexport type TMutable<RecordLike, ShallowOption extends boolean = true> = ShallowOption extends false ? {\n -readonly [Key in keyof RecordLike]: RecordLike[Key];\n} : ShallowOption extends true ? {\n -readonly [Key in keyof RecordLike]: TMutable<RecordLike[Key]>;\n} : never;\n/**\n * Given a {@link RecordLike | record-like type}, this type is the union\n * of the values of all properties in the {@link RecordLike | record-like type}.\n *\n * @template RecordLike - The record-like type from which this type extracts value types.\n */\nexport type TValues<RecordLike> = RecordLike[keyof RecordLike];\n/**\n * The element type of the return value of `Object.entries()`.\n *\n * @template RecordLike - The record-like type of the argument of `Object.entries()`.\n * @template KeyType - The subset of keys used by this type.\n */\nexport type TEntry<RecordLike, KeyType extends keyof RecordLike = keyof RecordLike> = [\n KeyType,\n RecordLike[KeyType]\n];\n/** The type used in `OptionsType`s when no options are specified. */\nexport type NoOptions = typeof NoOptions;\n/**\n * Define options for a given type as a union of `unique symbol` types.\n * All options must be *optional* by the type that uses these options.\n * The type that uses these options should have a type parameter `OptionsType`\n * defined with `OptionsType extends TOptions = NoOptions`. You will have to import\n * {@link NoOptions}, but this should be done anyway, since making all options types\n * optional should be optional. For this reason {@link NoOptions} is exported from the\n * same module as this type.\n *\n * @template OptionsType - The `unique symbol` types that act as options.\n *\n * @example * See the {@link Array.Options:type} type as an example.\n */\nexport type TOptions<OptionsType extends symbol = NoOptions> = OptionsType | NoOptions;\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 * Maps a given {@link RecordLike} type to an identical {@link Record} type, but\n * the properties are wrapped with {@link NonNullable}.\n *\n * @template RecordLike - The `Record`-like type from which this type is defined.\n */\nexport type TRecordNonNullable<RecordLike> = {\n [Key in keyof RecordLike]: NonNullable<RecordLike[Key]>;\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"],
5
+ "mappings": ";AAyEO,IAAM,0BAAN,cAAsC,MAAM;AAAA,EACxC,YAAY,WAAoB;AACnC,UAAM,SAAS;AAAA,EACnB;AACJ;;;ACnCA,eAAsB,IAAc,QAA6D;AAC7F,MAAI;AACA,UAAM,OAAiB,OAAO,WAAW,aACnC,MAAM,OAAO,IACb,MAAM;AACZ,WAAO;AAAA,MACH;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,SAAS,IAAI,aAAa;AACzE,SAAO,MAAM,QAAQ,IAAI,GAAG;AAChC;AAKO,IAAe,eAAf,MAA6E;AAAA,EACzE,KAAmD,cAAsD,aAA8E;AAC1L,UAAM,IAAI,wBAAwB,cAAc;AAAA,EACpD;AACJ;AAWO,IAAM,6BAAN,cAAyC,UAAU;AAAA,EAC/C,cAAc;AACjB,UAAM;AAAA,EACV;AACJ;AAMO,IAAM,WAAN,MAAM,kBAA8B,aAA8D;AAAA,EAC9F,YAAY,UAA6C;AAC5D,UAAM;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ps(__defProp({}, "__esModule", { value: tru
21
21
  // Source/Effect/index.ts
22
22
  var Effect_exports = {};
23
23
  __export(Effect_exports, {
24
- Effect: () => Index_Effect_exports
24
+ Effect: () => Effect_Types_exports
25
25
  });
26
26
  module.exports = __toCommonJS(Effect_exports);
27
+ __reExport(Effect_exports, require("effect"), module.exports);
27
28
 
28
- // Source/Effect/Index.Effect.ts
29
- var Index_Effect_exports = {};
30
- __export(Index_Effect_exports, {
31
- FooEffect: () => FooEffect
32
- });
33
-
34
- // Source/Effect/Effect.ts
35
- var FooEffect = "";
36
-
37
- // Source/Effect/Index.Effect.ts
38
- __reExport(Index_Effect_exports, require("effect"));
39
- /**
40
- * @file Effect.ts
41
- * @author Gage Sorrell <gage@sorrell.sh>
42
- * @copyright (c) 2026 Gage Sorrell
43
- * @license MIT
44
- */
29
+ // Source/Effect/Effect.Types.ts
30
+ var Effect_Types_exports = {};
45
31
  /**
46
32
  * @file Effect.Types.ts
47
33
  * @author Gage Sorrell <gage@sorrell.sh>
48
34
  * @copyright (c) 2026 Gage Sorrell
49
35
  * @license MIT
50
36
  */
51
- /**
52
- * @file Index.Effect.ts
53
- * @author Gage Sorrell <gage@sorrell.sh>
54
- * @copyright (c) 2026 Gage Sorrell
55
- * @license MIT
56
- */
57
37
  /**
58
38
  * @file index.ts
59
39
  * @author Gage Sorrell <gage@sorrell.sh>
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../Source/Effect/index.ts", "../Source/Effect/Index.Effect.ts", "../Source/Effect/Effect.ts"],
4
- "sourcesContent": ["/**\n * @file index.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nexport * as Effect from \"./Index.Effect.ts\";\n", "/**\n * @file Index.Effect.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nexport * from \"./Effect.ts\";\nexport * from \"./Effect.Types.ts\";\nexport * from \"effect\";\n", "/**\n * @file Effect.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nexport const FooEffect: string = \"\";\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;;;ACMO,IAAM,YAAoB;;;ADEjC,iCAAc;",
3
+ "sources": ["../Source/Effect/index.ts", "../Source/Effect/Effect.Types.ts"],
4
+ "sourcesContent": ["/**\n * @file index.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nexport * from \"effect\";\nexport * as Effect from \"./Effect.Types.ts\";\n", "/**\n * @file Effect.Types.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nimport type { Effect } from \"effect\";\nimport type { TFunction } from \"../Functional/index.ts\";\nexport namespace From {\n /**\n * Define an {@link Effect.Effect | effect type} such that each type parameter\n * is the respective union, generated from a given {@link FunctionsType | union}\n * of types of functions that return {@link Effect.Effect | effects}.\n *\n * @template FunctionsType - The {@link Array} of functions of some argument vector type(s),\n * which return {@link Effect.Effect | effects}.\n */\n export type Functions<FunctionsType extends Array<TFunction<Array<unknown>, Any>>> = Effects<ReturnType<FunctionsType[number]>>;\n /**\n * Define an {@link Effect.Effect | effect type} such that each type parameter\n * is the respective union, generated from a given union of {@link Effect.Effect | effects}.\n *\n * @template EffectType - The union of {@link Effect.Effect | effect types} from which\n * this {@link Effect.Effect | effect type} is generated.\n */\n export type Effects<EffectType extends Any> = Effect.Effect<EffectType extends Effect.Effect<infer SuccessType, unknown, unknown> ? SuccessType : never, EffectType extends Effect.Effect<unknown, infer ErrorType, unknown> ? ErrorType : never, EffectType extends Effect.Effect<unknown, unknown, infer RequirementsType> ? RequirementsType : never>;\n}\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/** A type representing *any* {@link Effect.Effect | effect}. */\nexport type Any = Effect.Effect<any, any, any>;\n/* eslint-enable @typescript-eslint/no-explicit-any */\n/**\n * A function that returns an {@link Effect.Effect | effect}.\n *\n * @template ArgumentVectorType - The tuple-type of this function's parameters.\n * @template EffectType - The type of the {@link Effect.Effect | effect} returned by this.\n */\nexport type Factory<ArgumentVectorType extends Array<unknown> = never, EffectType extends Any = Any> = [\n ArgumentVectorType\n] extends [\n never\n] ? {\n (): EffectType;\n} : {\n (...ArgumentVector: ArgumentVectorType): EffectType;\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,2BAAc,mBANd;;;ACAA;",
6
6
  "names": []
7
7
  }
@@ -1,54 +1,17 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
18
-
19
- // Source/Effect/Index.Effect.ts
20
- var Index_Effect_exports = {};
21
- __export(Index_Effect_exports, {
22
- FooEffect: () => FooEffect
23
- });
24
-
25
- // Source/Effect/Effect.ts
26
- var FooEffect = "";
1
+ // Source/Effect/index.ts
2
+ export * from "effect";
27
3
 
28
- // Source/Effect/Index.Effect.ts
29
- __reExport(Index_Effect_exports, effect_star);
30
- import * as effect_star from "effect";
4
+ // Source/Effect/Effect.Types.ts
5
+ var Effect_Types_exports = {};
31
6
  export {
32
- Index_Effect_exports as Effect
7
+ Effect_Types_exports as Effect
33
8
  };
34
- /**
35
- * @file Effect.ts
36
- * @author Gage Sorrell <gage@sorrell.sh>
37
- * @copyright (c) 2026 Gage Sorrell
38
- * @license MIT
39
- */
40
9
  /**
41
10
  * @file Effect.Types.ts
42
11
  * @author Gage Sorrell <gage@sorrell.sh>
43
12
  * @copyright (c) 2026 Gage Sorrell
44
13
  * @license MIT
45
14
  */
46
- /**
47
- * @file Index.Effect.ts
48
- * @author Gage Sorrell <gage@sorrell.sh>
49
- * @copyright (c) 2026 Gage Sorrell
50
- * @license MIT
51
- */
52
15
  /**
53
16
  * @file index.ts
54
17
  * @author Gage Sorrell <gage@sorrell.sh>
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../Source/Effect/Index.Effect.ts", "../Source/Effect/Effect.ts"],
4
- "sourcesContent": ["/**\n * @file Index.Effect.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nexport * from \"./Effect.ts\";\nexport * from \"./Effect.Types.ts\";\nexport * from \"effect\";\n", "/**\n * @file Effect.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nexport const FooEffect: string = \"\";\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;;;ACMO,IAAM,YAAoB;;;ADEjC;AAAA,6BAAc;",
3
+ "sources": ["../Source/Effect/index.ts", "../Source/Effect/Effect.Types.ts"],
4
+ "sourcesContent": ["/**\n * @file index.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nexport * from \"effect\";\nexport * as Effect from \"./Effect.Types.ts\";\n", "/**\n * @file Effect.Types.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nimport type { Effect } from \"effect\";\nimport type { TFunction } from \"../Functional/index.ts\";\nexport namespace From {\n /**\n * Define an {@link Effect.Effect | effect type} such that each type parameter\n * is the respective union, generated from a given {@link FunctionsType | union}\n * of types of functions that return {@link Effect.Effect | effects}.\n *\n * @template FunctionsType - The {@link Array} of functions of some argument vector type(s),\n * which return {@link Effect.Effect | effects}.\n */\n export type Functions<FunctionsType extends Array<TFunction<Array<unknown>, Any>>> = Effects<ReturnType<FunctionsType[number]>>;\n /**\n * Define an {@link Effect.Effect | effect type} such that each type parameter\n * is the respective union, generated from a given union of {@link Effect.Effect | effects}.\n *\n * @template EffectType - The union of {@link Effect.Effect | effect types} from which\n * this {@link Effect.Effect | effect type} is generated.\n */\n export type Effects<EffectType extends Any> = Effect.Effect<EffectType extends Effect.Effect<infer SuccessType, unknown, unknown> ? SuccessType : never, EffectType extends Effect.Effect<unknown, infer ErrorType, unknown> ? ErrorType : never, EffectType extends Effect.Effect<unknown, unknown, infer RequirementsType> ? RequirementsType : never>;\n}\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/** A type representing *any* {@link Effect.Effect | effect}. */\nexport type Any = Effect.Effect<any, any, any>;\n/* eslint-enable @typescript-eslint/no-explicit-any */\n/**\n * A function that returns an {@link Effect.Effect | effect}.\n *\n * @template ArgumentVectorType - The tuple-type of this function's parameters.\n * @template EffectType - The type of the {@link Effect.Effect | effect} returned by this.\n */\nexport type Factory<ArgumentVectorType extends Array<unknown> = never, EffectType extends Any = Any> = [\n ArgumentVectorType\n] extends [\n never\n] ? {\n (): EffectType;\n} : {\n (...ArgumentVector: ArgumentVectorType): EffectType;\n};\n"],
5
+ "mappings": ";AAMA,cAAc;;;ACNd;",
6
6
  "names": []
7
7
  }
@@ -30,6 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  // Source/FileSystem/index.ts
31
31
  var FileSystem_exports = {};
32
32
  __export(FileSystem_exports, {
33
+ DeleteWithProgress: () => DeleteWithProgress,
33
34
  GetSafeNewPath: () => GetSafeNewPath,
34
35
  IsSupportedFileExtension: () => IsSupportedFileExtension,
35
36
  IsValidFileName: () => IsValidFileName,
@@ -42,9 +43,11 @@ var import_path = require("path");
42
43
  var import_fs = require("fs");
43
44
  var import_fs2 = require("fs");
44
45
  var import_os = __toESM(require("os"), 1);
45
- async function PathExists(Path) {
46
+ var FileSystem = __toESM(require("node:fs/promises"), 1);
47
+ var Path = __toESM(require("node:path"), 1);
48
+ async function PathExists(Path2) {
46
49
  try {
47
- await import_fs.promises.access(Path, import_fs2.constants.F_OK);
50
+ await import_fs.promises.access(Path2, import_fs2.constants.F_OK);
48
51
  return true;
49
52
  } catch {
50
53
  return false;
@@ -104,8 +107,95 @@ async function IsValidFileName(DirectoryPath, FileName, PersistNewFile = false,
104
107
  return false;
105
108
  }
106
109
  }
107
- async function WriteTextFile(Path, Contents) {
108
- await import_fs.promises.writeFile(Path, Contents, { encoding: "utf-8" });
110
+ async function WriteTextFile(Path2, Contents) {
111
+ await import_fs.promises.writeFile(Path2, Contents, { encoding: "utf-8" });
112
+ }
113
+ function IsMissingFileError(ErrorValue) {
114
+ return typeof ErrorValue === "object" && ErrorValue !== null && "code" in ErrorValue && ErrorValue.code === "ENOENT";
115
+ }
116
+ function CloneProgress(Progress) {
117
+ return { ...Progress };
118
+ }
119
+ async function BuildDeletionPlan(RootPath, Progress, Options) {
120
+ const Entries = [];
121
+ async function Visit(CurrentPath) {
122
+ Options.Signal?.throwIfAborted();
123
+ Progress.Phase = "Scanning";
124
+ Progress.CurrentPath = CurrentPath;
125
+ Options.OnProgress?.(CloneProgress(Progress));
126
+ let Stats;
127
+ try {
128
+ Stats = await FileSystem.lstat(CurrentPath);
129
+ } catch (ErrorValue) {
130
+ if (IsMissingFileError(ErrorValue)) {
131
+ return;
132
+ }
133
+ throw ErrorValue;
134
+ }
135
+ if (Stats.isDirectory()) {
136
+ const Children = await FileSystem.readdir(CurrentPath, {
137
+ withFileTypes: true
138
+ });
139
+ for (const Child of Children) {
140
+ await Visit(Path.join(CurrentPath, Child.name));
141
+ }
142
+ Entries.push({
143
+ EntryPath: CurrentPath,
144
+ Kind: "Directory",
145
+ Size: 0
146
+ });
147
+ } else {
148
+ const Size = Stats.isFile() ? Stats.size : 0;
149
+ Entries.push({
150
+ EntryPath: CurrentPath,
151
+ Kind: Stats.isFile() ? "File" : "Other",
152
+ Size
153
+ });
154
+ Progress.TotalBytes += Size;
155
+ }
156
+ Progress.DiscoveredEntries = Entries.length;
157
+ Options.OnProgress?.(CloneProgress(Progress));
158
+ }
159
+ await Visit(RootPath);
160
+ return Entries;
161
+ }
162
+ async function DeleteWithProgress(RootPath, Options = {}) {
163
+ const Progress = {
164
+ Phase: "Scanning",
165
+ CurrentPath: null,
166
+ DiscoveredEntries: 0,
167
+ TotalEntries: 0,
168
+ DeletedEntries: 0,
169
+ TotalBytes: 0,
170
+ DeletedBytes: 0
171
+ };
172
+ const Entries = await BuildDeletionPlan(RootPath, Progress, Options);
173
+ Progress.Phase = "Deleting";
174
+ Progress.TotalEntries = Entries.length;
175
+ Progress.CurrentPath = null;
176
+ Options.OnProgress?.(CloneProgress(Progress));
177
+ for (const Entry of Entries) {
178
+ Options.Signal?.throwIfAborted();
179
+ Progress.CurrentPath = Entry.EntryPath;
180
+ Options.OnProgress?.(CloneProgress(Progress));
181
+ try {
182
+ if (Entry.Kind === "Directory") {
183
+ await FileSystem.rmdir(Entry.EntryPath);
184
+ } else {
185
+ await FileSystem.unlink(Entry.EntryPath);
186
+ }
187
+ } catch (ErrorValue) {
188
+ if (!IsMissingFileError(ErrorValue)) {
189
+ throw ErrorValue;
190
+ }
191
+ }
192
+ Progress.DeletedEntries += 1;
193
+ Progress.DeletedBytes += Entry.Size;
194
+ Options.OnProgress?.(CloneProgress(Progress));
195
+ }
196
+ Progress.Phase = "Done";
197
+ Progress.CurrentPath = null;
198
+ Options.OnProgress?.(CloneProgress(Progress));
109
199
  }
110
200
  /**
111
201
  * @file FileSystem.ts
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../Source/FileSystem/index.ts", "../Source/FileSystem/FileSystem.ts"],
4
- "sourcesContent": ["/**\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}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACMA,kBAAiD;AAGjD,gBAA+B;AAC/B,IAAAA,aAAyC;AACzC,gBAAe;AACf,eAAe,WAAW,MAAgC;AACtD,MAAI;AACA,UAAM,UAAAC,SAAG,OAAO,MAAM,WAAAC,UAAY,IAAI;AACtC,WAAO;AAAA,EACX,QACM;AACF,WAAO;AAAA,EACX;AACJ;AAKO,SAAS,yBAAyB,WAAoC;AACzE,MAAI,sBAA8B,UAAU,MAAM,CAAC;AACnD,MAAI,oBAAoB,WAAW,GAAG,GAAG;AACrC,0BAAsB,oBAAoB,MAAM,CAAC;AAAA,EACrD;AACA,MAAI,oBAAoB,WAAW,GAAG;AAClC,WAAO;AAAA,EACX;AACA,MAAI,oBAAoB,SAAS,GAAG,KAC7B,oBAAoB,SAAS,IAAI,KACjC,oBAAoB,SAAS,IAAI,GAAG;AACvC,WAAO;AAAA,EACX;AACA,MAAI,UAAAC,QAAG,SAAS,MAAM,SAAS;AAE3B,UAAM,uBAAgC,yBAAyB,KAAK,mBAAmB;AACvF,QAAI,sBAAsB;AACtB,aAAO;AAAA,IACX;AACA,QAAI,SAAS,KAAK,mBAAmB,GAAG;AACpC,aAAO;AAAA,IACX;AAAA,EACJ;AACA,SAAO;AACX;AAOA,eAAsB,eAAe,QAAiC;AAClE,QAAM,oBAAwB,qBAAQ,MAAM;AAC5C,QAAM,gBAAoB,qBAAQ,MAAM;AACxC,QAAM,eAAmB,sBAAS,MAAM;AACxC,QAAM,eAAuB,cAAc,KACrC,eACA,sBAAS,QAAQ,SAAS;AAChC,MAAI,gBAAwB;AAC5B,MAAI,QAAgB;AACpB,SAAO,MAAM,WAAW,aAAa,GAAG;AACpC,UAAM,oBAA4B,GAAG,YAAY,KAAK,KAAK,IAAI,SAAS;AACxE,wBAAgB,kBAAK,eAAe,iBAAiB;AACrD;AAAA,EACJ;AACA,SAAO;AACX;AAeA,eAAsB,gBAAgB,eAAuB,UAAkB,iBAA0B,OAAO,YAAwC,QAA6B;AACjL,QAAM,gBAA4C,cAAc,SACzD,UAAU,WAAW,GAAG,KAAK,yBAAyB,SAAS,IAC5D,YACA,OACJ;AACN,QAAM,sBAAgC,kBAAkB,QACpD,kBAAkB,OAClB,CAAC,SAAS,SAAS,aAAa;AACpC,MAAI,qBAAqB;AACrB,WAAO;AAAA,EACX;AACA,QAAM,eAAmB,kBAAK,eAAe,QAAQ;AACrD,MAAI;AACA,UAAM,iBAA6B,MAAM,UAAAF,SAAG,KAAK,UAAU,IAAI;AAC/D,UAAM,eAAe,MAAM;AAC3B,QAAI,CAAC,gBAAgB;AACjB,YAAM,UAAAA,SAAG,OAAO,QAAQ;AAAA,IAC5B;AACA,WAAO;AAAA,EACX,QACM;AACF,WAAO;AAAA,EACX;AACJ;AAoBA,eAAsB,cAAc,MAAc,UAAiC;AAC/E,QAAM,UAAAA,SAAG,UAAU,MAAM,UAAU,EAAE,UAAU,QAAQ,CAAC;AAC5D;",
6
- "names": ["import_fs", "Fs", "FsConstants", "os"]
4
+ "sourcesContent": ["/**\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"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACMA,kBAAiD;AAGjD,gBAA+B;AAC/B,IAAAA,aAAyC;AACzC,gBAAe;AA0Hf,iBAA4B;AAC5B,WAAsB;AA1HtB,eAAe,WAAWC,OAAgC;AACtD,MAAI;AACA,UAAM,UAAAC,SAAG,OAAOD,OAAM,WAAAE,UAAY,IAAI;AACtC,WAAO;AAAA,EACX,QACM;AACF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  import { promises as Fs } from "fs";
4
4
  import { constants as FsConstants } from "fs";
5
5
  import os from "os";
6
- async function PathExists(Path) {
6
+ import * as FileSystem from "node:fs/promises";
7
+ import * as Path from "node:path";
8
+ async function PathExists(Path2) {
7
9
  try {
8
- await Fs.access(Path, FsConstants.F_OK);
10
+ await Fs.access(Path2, FsConstants.F_OK);
9
11
  return true;
10
12
  } catch {
11
13
  return false;
@@ -65,10 +67,98 @@ async function IsValidFileName(DirectoryPath, FileName, PersistNewFile = false,
65
67
  return false;
66
68
  }
67
69
  }
68
- async function WriteTextFile(Path, Contents) {
69
- await Fs.writeFile(Path, Contents, { encoding: "utf-8" });
70
+ async function WriteTextFile(Path2, Contents) {
71
+ await Fs.writeFile(Path2, Contents, { encoding: "utf-8" });
72
+ }
73
+ function IsMissingFileError(ErrorValue) {
74
+ return typeof ErrorValue === "object" && ErrorValue !== null && "code" in ErrorValue && ErrorValue.code === "ENOENT";
75
+ }
76
+ function CloneProgress(Progress) {
77
+ return { ...Progress };
78
+ }
79
+ async function BuildDeletionPlan(RootPath, Progress, Options) {
80
+ const Entries = [];
81
+ async function Visit(CurrentPath) {
82
+ Options.Signal?.throwIfAborted();
83
+ Progress.Phase = "Scanning";
84
+ Progress.CurrentPath = CurrentPath;
85
+ Options.OnProgress?.(CloneProgress(Progress));
86
+ let Stats;
87
+ try {
88
+ Stats = await FileSystem.lstat(CurrentPath);
89
+ } catch (ErrorValue) {
90
+ if (IsMissingFileError(ErrorValue)) {
91
+ return;
92
+ }
93
+ throw ErrorValue;
94
+ }
95
+ if (Stats.isDirectory()) {
96
+ const Children = await FileSystem.readdir(CurrentPath, {
97
+ withFileTypes: true
98
+ });
99
+ for (const Child of Children) {
100
+ await Visit(Path.join(CurrentPath, Child.name));
101
+ }
102
+ Entries.push({
103
+ EntryPath: CurrentPath,
104
+ Kind: "Directory",
105
+ Size: 0
106
+ });
107
+ } else {
108
+ const Size = Stats.isFile() ? Stats.size : 0;
109
+ Entries.push({
110
+ EntryPath: CurrentPath,
111
+ Kind: Stats.isFile() ? "File" : "Other",
112
+ Size
113
+ });
114
+ Progress.TotalBytes += Size;
115
+ }
116
+ Progress.DiscoveredEntries = Entries.length;
117
+ Options.OnProgress?.(CloneProgress(Progress));
118
+ }
119
+ await Visit(RootPath);
120
+ return Entries;
121
+ }
122
+ async function DeleteWithProgress(RootPath, Options = {}) {
123
+ const Progress = {
124
+ Phase: "Scanning",
125
+ CurrentPath: null,
126
+ DiscoveredEntries: 0,
127
+ TotalEntries: 0,
128
+ DeletedEntries: 0,
129
+ TotalBytes: 0,
130
+ DeletedBytes: 0
131
+ };
132
+ const Entries = await BuildDeletionPlan(RootPath, Progress, Options);
133
+ Progress.Phase = "Deleting";
134
+ Progress.TotalEntries = Entries.length;
135
+ Progress.CurrentPath = null;
136
+ Options.OnProgress?.(CloneProgress(Progress));
137
+ for (const Entry of Entries) {
138
+ Options.Signal?.throwIfAborted();
139
+ Progress.CurrentPath = Entry.EntryPath;
140
+ Options.OnProgress?.(CloneProgress(Progress));
141
+ try {
142
+ if (Entry.Kind === "Directory") {
143
+ await FileSystem.rmdir(Entry.EntryPath);
144
+ } else {
145
+ await FileSystem.unlink(Entry.EntryPath);
146
+ }
147
+ } catch (ErrorValue) {
148
+ if (!IsMissingFileError(ErrorValue)) {
149
+ throw ErrorValue;
150
+ }
151
+ }
152
+ Progress.DeletedEntries += 1;
153
+ Progress.DeletedBytes += Entry.Size;
154
+ Options.OnProgress?.(CloneProgress(Progress));
155
+ }
156
+ Progress.Phase = "Done";
157
+ Progress.CurrentPath = null;
158
+ Options.OnProgress?.(CloneProgress(Progress));
70
159
  }
71
160
  export {
161
+ DeleteWithProgress,
72
162
  GetSafeNewPath,
73
163
  IsSupportedFileExtension,
74
164
  IsValidFileName,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../Source/FileSystem/FileSystem.ts"],
4
- "sourcesContent": ["/**\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}\n"],
5
- "mappings": ";AAMA,SAAS,UAAU,SAAS,SAAS,YAAY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G,KAAK,yBAAyB,SAAS,IAC5D,YACA,OACJ;AACN,QAAM,sBAAgC,kBAAkB,QACpD,kBAAkB,OAClB,CAAC,SAAS,SAAS,aAAa;AACpC,MAAI,qBAAqB;AACrB,WAAO;AAAA,EACX;AACA,QAAM,WAAmB,KAAK,eAAe,QAAQ;AACrD,MAAI;AACA,UAAM,iBAA6B,MAAM,GAAG,KAAK,UAAU,IAAI;AAC/D,UAAM,eAAe,MAAM;AAC3B,QAAI,CAAC,gBAAgB;AACjB,YAAM,GAAG,OAAO,QAAQ;AAAA,IAC5B;AACA,WAAO;AAAA,EACX,QACM;AACF,WAAO;AAAA,EACX;AACJ;AAoBA,eAAsB,cAAc,MAAc,UAAiC;AAC/E,QAAM,GAAG,UAAU,MAAM,UAAU,EAAE,UAAU,QAAQ,CAAC;AAC5D;",
6
- "names": []
4
+ "sourcesContent": ["/**\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"],
5
+ "mappings": ";AAMA,SAAS,UAAU,SAAS,SAAS,YAAY;AAGjD,SAAS,YAAY,UAAU;AAC/B,SAAS,aAAa,mBAAmB;AACzC,OAAO,QAAQ;AA0Hf,YAAY,gBAAgB;AAC5B,YAAY,UAAU;AA1HtB,eAAe,WAAWA,OAAgC;AACtD,MAAI;AACA,UAAM,GAAG,OAAOA,OAAM,YAAY,IAAI;AACtC,WAAO;AAAA,EACX,QACM;AACF,WAAO;AAAA,EACX;AACJ;AAKO,SAAS,yBAAyB,WAAoC;AACzE,MAAI,sBAA8B,UAAU,MAAM,CAAC;AACnD,MAAI,oBAAoB,WAAW,GAAG,GAAG;AACrC,0BAAsB,oBAAoB,MAAM,CAAC;AAAA,EACrD;AACA,MAAI,oBAAoB,WAAW,GAAG;AAClC,WAAO;AAAA,EACX;AACA,MAAI,oBAAoB,SAAS,GAAG,KAC7B,oBAAoB,SAAS,IAAI,KACjC,oBAAoB,SAAS,IAAI,GAAG;AACvC,WAAO;AAAA,EACX;AACA,MAAI,GAAG,SAAS,MAAM,SAAS;AAE3B,UAAM,uBAAgC,yBAAyB,KAAK,mBAAmB;AACvF,QAAI,sBAAsB;AACtB,aAAO;AAAA,IACX;AACA,QAAI,SAAS,KAAK,mBAAmB,GAAG;AACpC,aAAO;AAAA,IACX;AAAA,EACJ;AACA,SAAO;AACX;AAOA,eAAsB,eAAe,QAAiC;AAClE,QAAM,gBAAwB,QAAQ,MAAM;AAC5C,QAAM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AS,cAAc,MAAM;AAC7B,YAAQ,aAAa,cAAc,QAAQ,CAAC;AAC5C,QAAI;AACA,UAAI,MAAM,SAAS,aAAa;AAC5B,cAAiB,iBAAM,MAAM,SAAS;AAAA,MAC1C,OACK;AACD,cAAiB,kBAAO,MAAM,SAAS;AAAA,MAC3C;AAAA,IACJ,SACO,YAAY;AACf,UAAI,CAAC,mBAAmB,UAAU,GAAG;AACjC,cAAM;AAAA,MACV;AAAA,IACJ;AACA,aAAS,kBAAkB;AAC3B,aAAS,gBAAgB,MAAM;AAC/B,YAAQ,aAAa,cAAc,QAAQ,CAAC;AAAA,EAChD;AACA,WAAS,QAAQ;AACjB,WAAS,cAAc;AACvB,UAAQ,aAAa,cAAc,QAAQ,CAAC;AAChD;",
6
+ "names": ["Path"]
7
7
  }
@@ -25,8 +25,8 @@ __export(Functional_exports, {
25
25
  module.exports = __toCommonJS(Functional_exports);
26
26
 
27
27
  // Source/Functional/Functional.ts
28
- function Identity(...Arguments) {
29
- return Arguments;
28
+ function Identity(...ArgumentVector) {
29
+ return ArgumentVector;
30
30
  }
31
31
  /**
32
32
  * @file Functional.ts
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../Source/Functional/index.ts", "../Source/Functional/Functional.ts"],
4
- "sourcesContent": ["/**\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 */\nimport { CurriedArgument } from \"./Functional.Internal\";\nimport type { FCurriedArgument } from \"./Functional.Internal.Types\";\nimport type { TFunction } from \"./Functional.Types\";\nexport function Identity<Type>(...Arguments: Array<Type>) {\n return Arguments;\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACSO,SAAS,YAAkB,WAAwB;AACtD,SAAO;AACX;",
4
+ "sourcesContent": ["/**\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"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACaO,SAAS,YAA0B,gBAA4D;AAClG,SAAO;AACX;",
6
6
  "names": []
7
7
  }
@@ -1,6 +1,6 @@
1
1
  // Source/Functional/Functional.ts
2
- function Identity(...Arguments) {
3
- return Arguments;
2
+ function Identity(...ArgumentVector) {
3
+ return ArgumentVector;
4
4
  }
5
5
  export {
6
6
  Identity
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../Source/Functional/Functional.ts"],
4
- "sourcesContent": ["/**\n * @file Functional.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nimport { CurriedArgument } from \"./Functional.Internal\";\nimport type { FCurriedArgument } from \"./Functional.Internal.Types\";\nimport type { TFunction } from \"./Functional.Types\";\nexport function Identity<Type>(...Arguments: Array<Type>) {\n return Arguments;\n}\n"],
5
- "mappings": ";AASO,SAAS,YAAkB,WAAwB;AACtD,SAAO;AACX;",
4
+ "sourcesContent": ["/**\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"],
5
+ "mappings": ";AAaO,SAAS,YAA0B,gBAA4D;AAClG,SAAO;AACX;",
6
6
  "names": []
7
7
  }