@sorrell/utilities 1.1.60 → 1.1.61

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.
@@ -32,18 +32,19 @@ var FileSystem_exports = {};
32
32
  __export(FileSystem_exports, {
33
33
  GetSafeNewPath: () => GetSafeNewPath,
34
34
  IsSupportedFileExtension: () => IsSupportedFileExtension,
35
- IsValidFileName: () => IsValidFileName
35
+ IsValidFileName: () => IsValidFileName,
36
+ WriteTextFile: () => WriteTextFile
36
37
  });
37
38
  module.exports = __toCommonJS(FileSystem_exports);
38
39
 
39
40
  // Source/FileSystem/FileSystem.ts
40
- var import_promises = require("fs/promises");
41
41
  var import_path = require("path");
42
42
  var import_fs = require("fs");
43
+ var import_fs2 = require("fs");
43
44
  var import_os = __toESM(require("os"), 1);
44
45
  async function PathExists(Path) {
45
46
  try {
46
- await (0, import_promises.access)(Path, import_fs.constants.F_OK);
47
+ await import_fs.promises.access(Path, import_fs2.constants.F_OK);
47
48
  return true;
48
49
  } catch {
49
50
  return false;
@@ -93,16 +94,19 @@ async function IsValidFileName(DirectoryPath, FileName, PersistNewFile = false,
93
94
  }
94
95
  const FilePath = (0, import_path.join)(DirectoryPath, FileName);
95
96
  try {
96
- const ThisFileHandle = await (0, import_promises.open)(FilePath, "wx");
97
+ const ThisFileHandle = await import_fs.promises.open(FilePath, "wx");
97
98
  await ThisFileHandle.close();
98
99
  if (!PersistNewFile) {
99
- await (0, import_promises.unlink)(FilePath);
100
+ await import_fs.promises.unlink(FilePath);
100
101
  }
101
102
  return true;
102
103
  } catch {
103
104
  return false;
104
105
  }
105
106
  }
107
+ async function WriteTextFile(Path, Contents) {
108
+ await import_fs.promises.writeFile(Path, Contents, { encoding: "utf-8" });
109
+ }
106
110
  /**
107
111
  * @file FileSystem.ts
108
112
  * @author Gage Sorrell <gage@sorrell.sh>
@@ -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 { type FileHandle, access, open, unlink } from \"fs/promises\";\nimport { basename, dirname, extname, join } from \"path\";\nimport { type FFileExtension } from \"./FileSystem.Types.ts\";\nimport { constants as FsConstants } from \"fs\";\nimport os from \"os\";\nasync function PathExists(Path: string): Promise<boolean> {\n try {\n await 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 open(FilePath, \"wx\");\n await ThisFileHandle.close();\n if (!PersistNewFile) {\n await unlink(FilePath);\n }\n return true;\n }\n catch {\n return false;\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACMA,sBAAsD;AACtD,kBAAiD;AAEjD,gBAAyC;AACzC,gBAAe;AACf,eAAe,WAAW,MAAgC;AACtD,MAAI;AACA,cAAM,wBAAO,MAAM,UAAAA,UAAY,IAAI;AACnC,WAAO;AAAA,EACX,QACM;AACF,WAAO;AAAA,EACX;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e,QAAQ;AACrD,MAAI;AACA,UAAM,iBAA6B,UAAM,sBAAK,UAAU,IAAI;AAC5D,UAAM,eAAe,MAAM;AAC3B,QAAI,CAAC,gBAAgB;AACjB,gBAAM,wBAAO,QAAQ;AAAA,IACzB;AACA,WAAO;AAAA,EACX,QACM;AACF,WAAO;AAAA,EACX;AACJ;",
6
- "names": ["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}\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"]
7
7
  }
@@ -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 */\nexport function Identity<Type>(...Arguments: Array<Type>) {\n return Arguments;\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACMO,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 */\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;",
6
6
  "names": []
7
7
  }
@@ -256,17 +256,18 @@ var FileSystem_exports = {};
256
256
  __export(FileSystem_exports, {
257
257
  GetSafeNewPath: () => GetSafeNewPath,
258
258
  IsSupportedFileExtension: () => IsSupportedFileExtension,
259
- IsValidFileName: () => IsValidFileName
259
+ IsValidFileName: () => IsValidFileName,
260
+ WriteTextFile: () => WriteTextFile
260
261
  });
261
262
 
262
263
  // Source/FileSystem/FileSystem.ts
263
- var import_promises = require("fs/promises");
264
264
  var import_path = require("path");
265
265
  var import_fs = require("fs");
266
+ var import_fs2 = require("fs");
266
267
  var import_os = __toESM(require("os"), 1);
267
268
  async function PathExists(Path) {
268
269
  try {
269
- await (0, import_promises.access)(Path, import_fs.constants.F_OK);
270
+ await import_fs.promises.access(Path, import_fs2.constants.F_OK);
270
271
  return true;
271
272
  } catch {
272
273
  return false;
@@ -316,16 +317,19 @@ async function IsValidFileName(DirectoryPath, FileName, PersistNewFile = false,
316
317
  }
317
318
  const FilePath = (0, import_path.join)(DirectoryPath, FileName);
318
319
  try {
319
- const ThisFileHandle = await (0, import_promises.open)(FilePath, "wx");
320
+ const ThisFileHandle = await import_fs.promises.open(FilePath, "wx");
320
321
  await ThisFileHandle.close();
321
322
  if (!PersistNewFile) {
322
- await (0, import_promises.unlink)(FilePath);
323
+ await import_fs.promises.unlink(FilePath);
323
324
  }
324
325
  return true;
325
326
  } catch {
326
327
  return false;
327
328
  }
328
329
  }
330
+ async function WriteTextFile(Path, Contents) {
331
+ await import_fs.promises.writeFile(Path, Contents, { encoding: "utf-8" });
332
+ }
329
333
 
330
334
  // Source/Functional/index.ts
331
335
  var Functional_exports = {};
@@ -471,7 +475,7 @@ __export(Npm_exports, {
471
475
  });
472
476
 
473
477
  // Source/Npm/Npm.ts
474
- var import_fs2 = require("fs");
478
+ var import_fs3 = require("fs");
475
479
 
476
480
  // Source/Npm/Npm.Error.ts
477
481
  var import_effect = require("effect");
@@ -486,23 +490,23 @@ var import_process = __toESM(require("process"), 1);
486
490
  async function GetPackageJson(Path) {
487
491
  const RootDirectory = await GetPackageRootDirectory(Path);
488
492
  const PackageJsonPath = (0, import_path2.join)(RootDirectory, "package.json");
489
- const FileContents = await import_fs2.promises.readFile(PackageJsonPath, "utf-8");
493
+ const FileContents = await import_fs3.promises.readFile(PackageJsonPath, "utf-8");
490
494
  const PackageJson = await (async () => {
491
495
  try {
492
496
  return JSON.parse(FileContents);
493
497
  } catch (Cause) {
494
498
  throw new PackageJsonParseError({ Cause, Path: PackageJsonPath });
495
499
  }
496
- });
500
+ })();
497
501
  return PackageJson;
498
502
  }
499
503
  async function GetPackageRootDirectory(Path) {
500
- let CurrentDirectory = await import_fs2.promises.realpath(Path ?? import_process.default.cwd());
504
+ let CurrentDirectory = await import_fs3.promises.realpath(Path ?? import_process.default.cwd());
501
505
  while (true) {
502
506
  const PackageJsonPath = (0, import_path2.join)(CurrentDirectory, "package.json");
503
507
  const PackageJsonExists = await (async () => {
504
508
  try {
505
- await import_fs2.promises.access(PackageJsonPath, import_fs2.constants.F_OK);
509
+ await import_fs3.promises.access(PackageJsonPath, import_fs3.constants.F_OK);
506
510
  return true;
507
511
  } catch {
508
512
  return false;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
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/String/index.ts", "../../Source/String/String.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 String from \"./String/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 \"../Miscellaneous/Utility.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 */\nimport type * as TypeScript from \"typescript\";\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 union of a given {@link ElementType} and the array of a given {@link ElementType}.\n *\n * @template ElementType - The type of this, or the type of elements contained by this.\n */\nexport type TMaybeArray<ElementType> = ElementType | Array<ElementType>;\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;\nexport type TNullable<Type> = Type | null | undefined;\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\";\nexport type FTarget = \"es3\" | \"es5\" | \"es6\" | \"es2015\" | \"es2016\" | \"es2017\" | \"es2018\" | \"es2019\" | \"es2020\" | \"es2021\" | \"es2022\" | \"es2023\" | \"es2024\" | \"es2025\" | \"esnext\" | \"json\" | \"esnext\" | \"es2025\";\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 { type FileHandle, access, open, unlink } from \"fs/promises\";\nimport { basename, dirname, extname, join } from \"path\";\nimport { type FFileExtension } from \"./FileSystem.Types.ts\";\nimport { constants as FsConstants } from \"fs\";\nimport os from \"os\";\nasync function PathExists(Path: string): Promise<boolean> {\n try {\n await 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 open(FilePath, \"wx\");\n await ThisFileHandle.close();\n if (!PersistNewFile) {\n await unlink(FilePath);\n }\n return true;\n }\n catch {\n return false;\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 \"./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 */\nexport function Identity<Type>(...Arguments: Array<Type>) {\n return Arguments;\n}\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 \"./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/**\n * @param In - The string that you wish to test.\n * @returns Whether the given string contains *only* (Latin alphabet) letters.\n */\nexport function IsLetters(In: string): boolean {\n return /^[a-zA-Z]*$/.test(In);\n}\n/**\n * @remarks *(This is an alias for `IsOnlyLetters`).*\n *\n * @param In - The string that you wish to test.\n * @returns Whether the given string contains *only* (Latin alphabet) letters.\n */\nexport function IsAlpha(In: string): boolean {\n return IsLetters(In);\n}\n/**\n * @param In - The string that you wish to test.\n * @returns Whether the given string contains *only* numeric digits.\n */\nexport function IsNumeric(In: string): boolean {\n return /^\\d+$/.test(In);\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;;;ACgCO,SAAS,cAAuG,OAAuH;AAC1O,SAAO,MAAM,OAAO,CAAC,YAA8C;AAC/D,WAAO,YAAY;AAAA,EACvB,CAAC;AACL;;;ACpCA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;AC0EO,IAAM,0BAAN,cAAsC,MAAM;AAAA,EACxC,YAAY,WAAoB;AACnC,UAAM,SAAS;AAAA,EACnB;AACJ;;;ACpCA,eAAsB,IAAc,QAA6D;AAC7F,MAAI;AACA,UAAMA,QAAiB,OAAO,WAAW,aACnC,MAAM,OAAO,IACb,MAAM;AACZ,WAAO;AAAA,MACH,MAAAA;AAAA,MACA,OAAO;AAAA,I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,KAAK,CAAC;AAAA,IACjD;AACA,uBAAmB;AAAA,EACvB;AACJ;;;AEhIA;AAAA;AAAA;AAAA;;;ACMA,IAAAC,eAAqB;AACrB,IAAAC,yBAAyB;AAClB,IAAM,QAAN,MAAM,OAAM;AAAA,EAER,WAAmB;AACtB,WAAO,KAAK;AAAA,EAChB;AAAA,EAGO,YAAY,UAA0B;AACzC,QAAI,OAAO,aAAa,UAAU;AAC9B,WAAK,MAAM;AAAA,IACf,OACK;AACD,WAAK,MAAM,SAAS;AAAA,IACxB;AAAA,EACJ;AAAA,EAIA,CAAC,gCAAS,KAAK,EAAE,GAAmB,GAA0B;AAC1D,QAAI,OAAO,MAAM,UAAU;AACvB,aAAO,IAAI,WAAM,mBAAK,GAAI,EAAY,GAAG,CAAC;AAAA,IAC9C,WACS,OAAO,MAAM,UAAU;AAC5B,aAAO,IAAI,WAAM,mBAAM,EAAY,KAAK,CAAC,CAAC;AAAA,IAC9C,OACK;AACD,aAAO,IAAI,WAAM,mBAAM,EAAY,KAAM,EAAY,GAAG,CAAC;AAAA,IAC7D;AAAA,EACJ;AACJ;;;ACrCA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACcO,SAAS,UAAU,IAAqB;AAC3C,SAAO,cAAc,KAAK,EAAE;AAChC;AAOO,SAAS,QAAQ,IAAqB;AACzC,SAAO,UAAU,EAAE;AACvB;AAKO,SAAS,UAAU,IAAqB;AAC3C,SAAO,QAAQ,KAAK,EAAE;AAC1B;",
6
- "names": ["Data", "FsConstants", "os", "import_tsover_runtime", "import_fs", "import_path", "Fs", "Process", "FsConstants", "import_path", "import_tsover_runtime"]
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 String from \"./String/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 \"../Miscellaneous/Utility.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 */\nimport type * as TypeScript from \"typescript\";\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 union of a given {@link ElementType} and the array of a given {@link ElementType}.\n *\n * @template ElementType - The type of this, or the type of elements contained by this.\n */\nexport type TMaybeArray<ElementType> = ElementType | Array<ElementType>;\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;\nexport type TNullable<Type> = Type | null | undefined;\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\";\nexport type FTarget = \"es3\" | \"es5\" | \"es6\" | \"es2015\" | \"es2016\" | \"es2017\" | \"es2018\" | \"es2019\" | \"es2020\" | \"es2021\" | \"es2022\" | \"es2023\" | \"es2024\" | \"es2025\" | \"esnext\" | \"json\" | \"esnext\" | \"es2025\";\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}\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 */\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", "/**\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 \"./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/**\n * @param In - The string that you wish to test.\n * @returns Whether the given string contains *only* (Latin alphabet) letters.\n */\nexport function IsLetters(In: string): boolean {\n return /^[a-zA-Z]*$/.test(In);\n}\n/**\n * @remarks *(This is an alias for `IsOnlyLetters`).*\n *\n * @param In - The string that you wish to test.\n * @returns Whether the given string contains *only* (Latin alphabet) letters.\n */\nexport function IsAlpha(In: string): boolean {\n return IsLetters(In);\n}\n/**\n * @param In - The string that you wish to test.\n * @returns Whether the given string contains *only* numeric digits.\n */\nexport function IsNumeric(In: string): boolean {\n return /^\\d+$/.test(In);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;;;ACgCO,SAAS,cAAuG,OAAuH;AAC1O,SAAO,MAAM,OAAO,CAAC,YAA8C;AAC/D,WAAO,YAAY;AAAA,EACvB,CAAC;AACL;;;ACpCA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;AC0EO,IAAM,0BAAN,cAAsC,MAAM;AAAA,EACxC,YAAY,WAAoB;AACnC,UAAM,SAAS;AAAA,EACnB;AACJ;;;ACpCA,eAAsB,IAAc,QAA6D;AAC7F,MAAI;AACA,UAAMA,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,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,Y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,KAAK,EAAE,GAAmB,GAA0B;AAC1D,QAAI,OAAO,MAAM,UAAU;AACvB,aAAO,IAAI,WAAM,mBAAK,GAAI,EAAY,GAAG,CAAC;AAAA,IAC9C,WACS,OAAO,MAAM,UAAU;AAC5B,aAAO,IAAI,WAAM,mBAAM,EAAY,KAAK,CAAC,CAAC;AAAA,IAC9C,OACK;AACD,aAAO,IAAI,WAAM,mBAAM,EAAY,KAAM,EAAY,GAAG,CAAC;AAAA,IAC7D;AAAA,EACJ;AACJ;;;ACrCA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACcO,SAAS,UAAU,IAAqB;AAC3C,SAAO,cAAc,KAAK,EAAE;AAChC;AAOO,SAAS,QAAQ,IAAqB;AACzC,SAAO,UAAU,EAAE;AACvB;AAKO,SAAS,UAAU,IAAqB;AAC3C,SAAO,QAAQ,KAAK,EAAE;AAC1B;",
6
+ "names": ["Data", "import_fs", "Fs", "FsConstants", "os", "import_tsover_runtime", "import_fs", "import_path", "Fs", "Process", "FsConstants", "import_path", "import_tsover_runtime"]
7
7
  }
@@ -60,7 +60,7 @@ async function GetPackageJson(Path) {
60
60
  } catch (Cause) {
61
61
  throw new PackageJsonParseError({ Cause, Path: PackageJsonPath });
62
62
  }
63
- });
63
+ })();
64
64
  return PackageJson;
65
65
  }
66
66
  async function GetPackageRootDirectory(Path) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../Source/Npm/index.ts", "../../Source/Npm/Npm.ts", "../../Source/Npm/Npm.Error.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 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"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACMA,gBAAyD;;;ACAzD,oBAAqB;AAQd,IAAM,wBAAN,cAAoC,mBAAK,YAAY,uBAAuB,EAGhF;AACH;AAOO,IAAM,6BAAN,cAAyC,mBAAK,YAAY,uBAAuB,EAErF;AACH;;;ADpBA,kBAA8B;AAE9B,qBAAoB;AAqBpB,eAAsB,eAAe,MAAsC;AACvE,QAAM,gBAAwB,MAAM,wBAAwB,IAAI;AAChE,QAAM,sBAA0B,kBAAK,eAAe,cAAc;AAClE,QAAM,eAAuB,MAAM,UAAAA,SAAG,SAAS,iBAAiB,OAAO;AACvE,QAAM,cAA4B,OAAO,YAAmC;AACxE,QAAI;AACA,aAAO,KAAK,MAAM,YAAY;AAAA,IAClC,SACO,OAAgB;AACnB,YAAM,IAAI,sBAAsB,EAAE,OAAO,MAAM,gBAAgB,CAAC;AAAA,IACpE;AAAA,EACJ;AACA,SAAO;AACX;AA8DA,eAAsB,wBAAwB,MAAgC;AAC1E,MAAI,mBAA2B,MAAM,UAAAA,SAAG,SAAS,QAAQ,eAAAC,QAAQ,IAAI,CAAC;AACtE,SAAO,MAAM;AACT,UAAM,sBAA0B,kBAAK,kBAAkB,cAAc;AACrE,UAAM,oBAA6B,OAAO,YAA8B;AACpE,UAAI;AACA,cAAM,UAAAD,SAAG,OAAO,iBAAiB,UAAAE,UAAY,IAAI;AACjD,eAAO;AAAA,MACX,QACM;AACF,eAAO;AAAA,MACX;AAAA,IACJ,GAAG;AACH,QAAI,mBAAmB;AACnB,aAAO;AAAA,IACX;AACA,UAAM,sBAA0B,qBAAQ,gBAAgB;AACxD,QAAI,oBAAoB,kBAAkB;AACtC,YAAM,IAAI,2BAA2B,EAAE,KAAK,CAAC;AAAA,IACjD;AACA,uBAAmB;AAAA,EACvB;AACJ;",
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 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"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACMA,gBAAyD;;;ACAzD,oBAAqB;AAQd,IAAM,wBAAN,cAAoC,mBAAK,YAAY,uBAAuB,EAGhF;AACH;AAOO,IAAM,6BAAN,cAAyC,mBAAK,YAAY,uBAAuB,EAErF;AACH;;;ADpBA,kBAA8B;AAE9B,qBAAoB;AAqBpB,eAAsB,eAAe,MAAsC;AACvE,QAAM,gBAAwB,MAAM,wBAAwB,IAAI;AAChE,QAAM,sBAA0B,kBAAK,eAAe,cAAc;AAClE,QAAM,eAAuB,MAAM,UAAAA,SAAG,SAAS,iBAAiB,OAAO;AACvE,QAAM,cAA4B,OAAO,YAAmC;AACxE,QAAI;AACA,aAAO,KAAK,MAAM,YAAY;AAAA,IAClC,SACO,OAAgB;AACnB,YAAM,IAAI,sBAAsB,EAAE,OAAO,MAAM,gBAAgB,CAAC;AAAA,IACpE;AAAA,EACJ,GAAG;AACH,SAAO;AACX;AA8DA,eAAsB,wBAAwB,MAAgC;AAC1E,MAAI,mBAA2B,MAAM,UAAAA,SAAG,SAAS,QAAQ,eAAAC,QAAQ,IAAI,CAAC;AACtE,SAAO,MAAM;AACT,UAAM,sBAA0B,kBAAK,kBAAkB,cAAc;AACrE,UAAM,oBAA6B,OAAO,YAA8B;AACpE,UAAI;AACA,cAAM,UAAAD,SAAG,OAAO,iBAAiB,UAAAE,UAAY,IAAI;AACjD,eAAO;AAAA,MACX,QACM;AACF,eAAO;AAAA,MACX;AAAA,IACJ,GAAG;AACH,QAAI,mBAAmB;AACnB,aAAO;AAAA,IACX;AACA,UAAM,sBAA0B,qBAAQ,gBAAgB;AACxD,QAAI,oBAAoB,kBAAkB;AACtC,YAAM,IAAI,2BAA2B,EAAE,KAAK,CAAC;AAAA,IACjD;AACA,uBAAmB;AAAA,EACvB;AACJ;",
6
6
  "names": ["Fs", "Process", "FsConstants"]
7
7
  }
@@ -1,11 +1,11 @@
1
1
  // Source/FileSystem/FileSystem.ts
2
- import { access, open, unlink } from "fs/promises";
3
2
  import { basename, dirname, extname, join } from "path";
3
+ import { promises as Fs } from "fs";
4
4
  import { constants as FsConstants } from "fs";
5
5
  import os from "os";
6
6
  async function PathExists(Path) {
7
7
  try {
8
- await access(Path, FsConstants.F_OK);
8
+ await Fs.access(Path, FsConstants.F_OK);
9
9
  return true;
10
10
  } catch {
11
11
  return false;
@@ -55,20 +55,24 @@ async function IsValidFileName(DirectoryPath, FileName, PersistNewFile = false,
55
55
  }
56
56
  const FilePath = join(DirectoryPath, FileName);
57
57
  try {
58
- const ThisFileHandle = await open(FilePath, "wx");
58
+ const ThisFileHandle = await Fs.open(FilePath, "wx");
59
59
  await ThisFileHandle.close();
60
60
  if (!PersistNewFile) {
61
- await unlink(FilePath);
61
+ await Fs.unlink(FilePath);
62
62
  }
63
63
  return true;
64
64
  } catch {
65
65
  return false;
66
66
  }
67
67
  }
68
+ async function WriteTextFile(Path, Contents) {
69
+ await Fs.writeFile(Path, Contents, { encoding: "utf-8" });
70
+ }
68
71
  export {
69
72
  GetSafeNewPath,
70
73
  IsSupportedFileExtension,
71
- IsValidFileName
74
+ IsValidFileName,
75
+ WriteTextFile
72
76
  };
73
77
  /**
74
78
  * @file FileSystem.ts
@@ -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 { type FileHandle, access, open, unlink } from \"fs/promises\";\nimport { basename, dirname, extname, join } from \"path\";\nimport { type FFileExtension } from \"./FileSystem.Types.ts\";\nimport { constants as FsConstants } from \"fs\";\nimport os from \"os\";\nasync function PathExists(Path: string): Promise<boolean> {\n try {\n await 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 open(FilePath, \"wx\");\n await ThisFileHandle.close();\n if (!PersistNewFile) {\n await unlink(FilePath);\n }\n return true;\n }\n catch {\n return false;\n }\n}\n"],
5
- "mappings": ";AAMA,SAA0B,QAAQ,MAAM,cAAc;AACtD,SAAS,UAAU,SAAS,SAAS,YA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,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,KAAK,UAAU,IAAI;AAC5D,UAAM,eAAe,MAAM;AAC3B,QAAI,CAAC,gBAAgB;AACjB,YAAM,OAAO,QAAQ;AAAA,IACzB;AACA,WAAO;AAAA,EACX,QACM;AACF,WAAO;AAAA,EACX;AACJ;",
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;AAGjD,SAAS,YAAY,UAAU;AAC/B,SAAS,aAAa,mBAAmB;AACzC,OAAO,QAAQ;AACf,eAAe,WAAW,MAAgC;AACtD,MAAI;AACA,UAAM,GAAG,OAAO,MAAM,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,YAAoB,QAAQ,MAAM;AACxC,QAAM,WAAmB,SAAS,MAAM;AACxC,QAAM,eAAuB,cAAc,KACrC,WACA,SAAS,QAAQ,SAAS;AAChC,MAAI,gBAAwB;AAC5B,MAAI,QAAgB;AACpB,SAAO,MAAM,WAAW,aAAa,GAAG;AACpC,UAAM,oBAA4B,GAAG,YAAY,KAAK,KAAK,IAAI,SAAS;AACxE,oBAAgB,KAAK,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,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
6
  "names": []
7
7
  }
@@ -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 */\nexport function Identity<Type>(...Arguments: Array<Type>) {\n return Arguments;\n}\n"],
5
- "mappings": ";AAMO,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 */\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;",
6
6
  "names": []
7
7
  }
@@ -217,17 +217,18 @@ var FileSystem_exports = {};
217
217
  __export(FileSystem_exports, {
218
218
  GetSafeNewPath: () => GetSafeNewPath,
219
219
  IsSupportedFileExtension: () => IsSupportedFileExtension,
220
- IsValidFileName: () => IsValidFileName
220
+ IsValidFileName: () => IsValidFileName,
221
+ WriteTextFile: () => WriteTextFile
221
222
  });
222
223
 
223
224
  // Source/FileSystem/FileSystem.ts
224
- import { access, open, unlink } from "fs/promises";
225
225
  import { basename, dirname, extname, join } from "path";
226
+ import { promises as Fs } from "fs";
226
227
  import { constants as FsConstants } from "fs";
227
228
  import os from "os";
228
229
  async function PathExists(Path) {
229
230
  try {
230
- await access(Path, FsConstants.F_OK);
231
+ await Fs.access(Path, FsConstants.F_OK);
231
232
  return true;
232
233
  } catch {
233
234
  return false;
@@ -277,16 +278,19 @@ async function IsValidFileName(DirectoryPath, FileName, PersistNewFile = false,
277
278
  }
278
279
  const FilePath = join(DirectoryPath, FileName);
279
280
  try {
280
- const ThisFileHandle = await open(FilePath, "wx");
281
+ const ThisFileHandle = await Fs.open(FilePath, "wx");
281
282
  await ThisFileHandle.close();
282
283
  if (!PersistNewFile) {
283
- await unlink(FilePath);
284
+ await Fs.unlink(FilePath);
284
285
  }
285
286
  return true;
286
287
  } catch {
287
288
  return false;
288
289
  }
289
290
  }
291
+ async function WriteTextFile(Path, Contents) {
292
+ await Fs.writeFile(Path, Contents, { encoding: "utf-8" });
293
+ }
290
294
 
291
295
  // Source/Functional/index.ts
292
296
  var Functional_exports = {};
@@ -432,7 +436,7 @@ __export(Npm_exports, {
432
436
  });
433
437
 
434
438
  // Source/Npm/Npm.ts
435
- import { promises as Fs, constants as FsConstants2 } from "fs";
439
+ import { promises as Fs2, constants as FsConstants2 } from "fs";
436
440
 
437
441
  // Source/Npm/Npm.Error.ts
438
442
  import { Data } from "effect";
@@ -447,23 +451,23 @@ import Process from "process";
447
451
  async function GetPackageJson(Path) {
448
452
  const RootDirectory = await GetPackageRootDirectory(Path);
449
453
  const PackageJsonPath = join2(RootDirectory, "package.json");
450
- const FileContents = await Fs.readFile(PackageJsonPath, "utf-8");
454
+ const FileContents = await Fs2.readFile(PackageJsonPath, "utf-8");
451
455
  const PackageJson = await (async () => {
452
456
  try {
453
457
  return JSON.parse(FileContents);
454
458
  } catch (Cause) {
455
459
  throw new PackageJsonParseError({ Cause, Path: PackageJsonPath });
456
460
  }
457
- });
461
+ })();
458
462
  return PackageJson;
459
463
  }
460
464
  async function GetPackageRootDirectory(Path) {
461
- let CurrentDirectory = await Fs.realpath(Path ?? Process.cwd());
465
+ let CurrentDirectory = await Fs2.realpath(Path ?? Process.cwd());
462
466
  while (true) {
463
467
  const PackageJsonPath = join2(CurrentDirectory, "package.json");
464
468
  const PackageJsonExists = await (async () => {
465
469
  try {
466
- await Fs.access(PackageJsonPath, FsConstants2.F_OK);
470
+ await Fs2.access(PackageJsonPath, FsConstants2.F_OK);
467
471
  return true;
468
472
  } catch {
469
473
  return false;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../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/String/index.ts", "../../Source/String/String.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 \"./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 \"../Miscellaneous/Utility.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 */\nimport type * as TypeScript from \"typescript\";\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 union of a given {@link ElementType} and the array of a given {@link ElementType}.\n *\n * @template ElementType - The type of this, or the type of elements contained by this.\n */\nexport type TMaybeArray<ElementType> = ElementType | Array<ElementType>;\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;\nexport type TNullable<Type> = Type | null | undefined;\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\";\nexport type FTarget = \"es3\" | \"es5\" | \"es6\" | \"es2015\" | \"es2016\" | \"es2017\" | \"es2018\" | \"es2019\" | \"es2020\" | \"es2021\" | \"es2022\" | \"es2023\" | \"es2024\" | \"es2025\" | \"esnext\" | \"json\" | \"esnext\" | \"es2025\";\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 { type FileHandle, access, open, unlink } from \"fs/promises\";\nimport { basename, dirname, extname, join } from \"path\";\nimport { type FFileExtension } from \"./FileSystem.Types.ts\";\nimport { constants as FsConstants } from \"fs\";\nimport os from \"os\";\nasync function PathExists(Path: string): Promise<boolean> {\n try {\n await 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 open(FilePath, \"wx\");\n await ThisFileHandle.close();\n if (!PersistNewFile) {\n await unlink(FilePath);\n }\n return true;\n }\n catch {\n return false;\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 \"./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 */\nexport function Identity<Type>(...Arguments: Array<Type>) {\n return Arguments;\n}\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 \"./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/**\n * @param In - The string that you wish to test.\n * @returns Whether the given string contains *only* (Latin alphabet) letters.\n */\nexport function IsLetters(In: string): boolean {\n return /^[a-zA-Z]*$/.test(In);\n}\n/**\n * @remarks *(This is an alias for `IsOnlyLetters`).*\n *\n * @param In - The string that you wish to test.\n * @returns Whether the given string contains *only* (Latin alphabet) letters.\n */\nexport function IsAlpha(In: string): boolean {\n return IsLetters(In);\n}\n/**\n * @param In - The string that you wish to test.\n * @returns Whether the given string contains *only* numeric digits.\n */\nexport function IsNumeric(In: string): boolean {\n return /^\\d+$/.test(In);\n}\n"],
5
- "mappings": ";;;;;;;AAAA;AAAA;AAAA;AAAA;;;ACgCO,SAAS,cAAuG,OAAuH;AAC1O,SAAO,MAAM,OAAO,CAAC,YAA8C;AAC/D,WAAO,YAAY;AAAA,EACvB,CAAC;AACL;;;ACpCA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;AC0EO,IAAM,0BAAN,cAAsC,MAAM;AAAA,EACxC,YAAY,WAAoB;AACnC,UAAM,SAAS;AAAA,EACnB;AACJ;;;ACpCA,eAAsB,IAAc,QAA6D;AAC7F,MAAI;AACA,UAAMA,QAAiB,OAAO,WAAW,aACnC,MAAM,OAAO,IACb,MAAM;AACZ,WAAO;AAAA,MACH,MAAAA;AAAA,MACA,OAAO;AAAA,IACX;A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;AACtC,YAAM,IAAI,2BAA2B,EAAE,KAAK,CAAC;AAAA,IACjD;AACA,uBAAmB;AAAA,EACvB;AACJ;;;AEhIA;AAAA;AAAA;AAAA;;;ACMA,SAAS,QAAAG,aAAY;AACrB,SAAS,YAAAC,iBAAgB;AAClB,IAAM,QAAN,MAAM,OAAM;AAAA,EAER,WAAmB;AACtB,WAAO,KAAK;AAAA,EAChB;AAAA,EAGO,YAAY,UAA0B;AACzC,QAAI,OAAO,aAAa,UAAU;AAC9B,WAAK,MAAM;AAAA,IACf,OACK;AACD,WAAK,MAAM,SAAS;AAAA,IACxB;AAAA,EACJ;AAAA,EAIA,CAACA,UAAS,KAAK,EAAE,GAAmB,GAA0B;AAC1D,QAAI,OAAO,MAAM,UAAU;AACvB,aAAO,IAAI,OAAMD,MAAK,GAAI,EAAY,GAAG,CAAC;AAAA,IAC9C,WACS,OAAO,MAAM,UAAU;AAC5B,aAAO,IAAI,OAAMA,MAAM,EAAY,KAAK,CAAC,CAAC;AAAA,IAC9C,OACK;AACD,aAAO,IAAI,OAAMA,MAAM,EAAY,KAAM,EAAY,GAAG,CAAC;AAAA,IAC7D;AAAA,EACJ;AACJ;;;ACrCA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACcO,SAAS,UAAU,IAAqB;AAC3C,SAAO,cAAc,KAAK,EAAE;AAChC;AAOO,SAAS,QAAQ,IAAqB;AACzC,SAAO,UAAU,EAAE;AACvB;AAKO,SAAS,UAAU,IAAqB;AAC3C,SAAO,QAAQ,KAAK,EAAE;AAC1B;",
6
- "names": ["Data", "Operator", "FsConstants", "dirname", "join", "FsConstants", "join", "Operator"]
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 \"./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 \"../Miscellaneous/Utility.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 */\nimport type * as TypeScript from \"typescript\";\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 union of a given {@link ElementType} and the array of a given {@link ElementType}.\n *\n * @template ElementType - The type of this, or the type of elements contained by this.\n */\nexport type TMaybeArray<ElementType> = ElementType | Array<ElementType>;\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;\nexport type TNullable<Type> = Type | null | undefined;\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\";\nexport type FTarget = \"es3\" | \"es5\" | \"es6\" | \"es2015\" | \"es2016\" | \"es2017\" | \"es2018\" | \"es2019\" | \"es2020\" | \"es2021\" | \"es2022\" | \"es2023\" | \"es2024\" | \"es2025\" | \"esnext\" | \"json\" | \"esnext\" | \"es2025\";\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}\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 */\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", "/**\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 \"./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/**\n * @param In - The string that you wish to test.\n * @returns Whether the given string contains *only* (Latin alphabet) letters.\n */\nexport function IsLetters(In: string): boolean {\n return /^[a-zA-Z]*$/.test(In);\n}\n/**\n * @remarks *(This is an alias for `IsOnlyLetters`).*\n *\n * @param In - The string that you wish to test.\n * @returns Whether the given string contains *only* (Latin alphabet) letters.\n */\nexport function IsAlpha(In: string): boolean {\n return IsLetters(In);\n}\n/**\n * @param In - The string that you wish to test.\n * @returns Whether the given string contains *only* numeric digits.\n */\nexport function IsNumeric(In: string): boolean {\n return /^\\d+$/.test(In);\n}\n"],
5
+ "mappings": ";;;;;;;AAAA;AAAA;AAAA;AAAA;;;ACgCO,SAAS,cAAuG,OAAuH;AAC1O,SAAO,MAAM,OAAO,CAAC,YAA8C;AAC/D,WAAO,YAAY;AAAA,EACvB,CAAC;AACL;;;ACpCA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;AC0EO,IAAM,0BAAN,cAAsC,MAAM;AAAA,EACxC,YAAY,WAAoB;AACnC,UAAM,SAAS;AAAA,EACnB;AACJ;;;ACpCA,eAAsB,IAAc,QAA6D;AAC7F,MAAI;AACA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sConstants", "dirname", "join", "Fs", "FsConstants", "join", "Operator"]
7
7
  }
@@ -21,7 +21,7 @@ async function GetPackageJson(Path) {
21
21
  } catch (Cause) {
22
22
  throw new PackageJsonParseError({ Cause, Path: PackageJsonPath });
23
23
  }
24
- });
24
+ })();
25
25
  return PackageJson;
26
26
  }
27
27
  async function GetPackageRootDirectory(Path) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../Source/Npm/Npm.ts", "../../Source/Npm/Npm.Error.ts"],
4
- "sourcesContent": ["/**\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"],
5
- "mappings": ";AAMA,SAAS,YAAY,IAAI,aAAa,mBAAmB;;;ACAzD,SAAS,YAAY;AAQd,IAAM,wBAAN,cAAoC,KAAK,YAAY,uBAAuB,EAGhF;AACH;AAOO,IAAM,6BAAN,cAAyC,KAAK,YAAY,uBAAuB,EAErF;AACH;;;ADpBA,SAAS,SAAS,YAAY;AAE9B,OAAO,aAAa;AAqBpB,eAAsB,eAAe,MAAsC;AACvE,QAAM,gBAAwB,MAAM,wBAAwB,IAAI;AAChE,QAAM,kBAA0B,KAAK,eAAe,cAAc;AAClE,QAAM,eAAuB,MAAM,GAAG,SAAS,iBAAiB,OAAO;AACvE,QAAM,cAA4B,OAAO,YAAmC;AACxE,QAAI;AACA,aAAO,KAAK,MAAM,YAAY;AAAA,IAClC,SACO,OAAgB;AACnB,YAAM,IAAI,sBAAsB,EAAE,OAAO,MAAM,gBAAgB,CAAC;AAAA,IACpE;AAAA,EACJ;AACA,SAAO;AACX;AA8DA,eAAsB,wBAAwB,MAAgC;AAC1E,MAAI,mBAA2B,MAAM,GAAG,SAAS,QAAQ,QAAQ,IAAI,CAAC;AACtE,SAAO,MAAM;AACT,UAAM,kBAA0B,KAAK,kBAAkB,cAAc;AACrE,UAAM,oBAA6B,OAAO,YAA8B;AACpE,UAAI;AACA,cAAM,GAAG,OAAO,iBAAiB,YAAY,IAAI;AACjD,eAAO;AAAA,MACX,QACM;AACF,eAAO;AAAA,MACX;AAAA,IACJ,GAAG;AACH,QAAI,mBAAmB;AACnB,aAAO;AAAA,IACX;AACA,UAAM,kBAA0B,QAAQ,gBAAgB;AACxD,QAAI,oBAAoB,kBAAkB;AACtC,YAAM,IAAI,2BAA2B,EAAE,KAAK,CAAC;AAAA,IACjD;AACA,uBAAmB;AAAA,EACvB;AACJ;",
4
+ "sourcesContent": ["/**\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"],
5
+ "mappings": ";AAMA,SAAS,YAAY,IAAI,aAAa,mBAAmB;;;ACAzD,SAAS,YAAY;AAQd,IAAM,wBAAN,cAAoC,KAAK,YAAY,uBAAuB,EAGhF;AACH;AAOO,IAAM,6BAAN,cAAyC,KAAK,YAAY,uBAAuB,EAErF;AACH;;;ADpBA,SAAS,SAAS,YAAY;AAE9B,OAAO,aAAa;AAqBpB,eAAsB,eAAe,MAAsC;AACvE,QAAM,gBAAwB,MAAM,wBAAwB,IAAI;AAChE,QAAM,kBAA0B,KAAK,eAAe,cAAc;AAClE,QAAM,eAAuB,MAAM,GAAG,SAAS,iBAAiB,OAAO;AACvE,QAAM,cAA4B,OAAO,YAAmC;AACxE,QAAI;AACA,aAAO,KAAK,MAAM,YAAY;AAAA,IAClC,SACO,OAAgB;AACnB,YAAM,IAAI,sBAAsB,EAAE,OAAO,MAAM,gBAAgB,CAAC;AAAA,IACpE;AAAA,EACJ,GAAG;AACH,SAAO;AACX;AA8DA,eAAsB,wBAAwB,MAAgC;AAC1E,MAAI,mBAA2B,MAAM,GAAG,SAAS,QAAQ,QAAQ,IAAI,CAAC;AACtE,SAAO,MAAM;AACT,UAAM,kBAA0B,KAAK,kBAAkB,cAAc;AACrE,UAAM,oBAA6B,OAAO,YAA8B;AACpE,UAAI;AACA,cAAM,GAAG,OAAO,iBAAiB,YAAY,IAAI;AACjD,eAAO;AAAA,MACX,QACM;AACF,eAAO;AAAA,MACX;AAAA,IACJ,GAAG;AACH,QAAI,mBAAmB;AACnB,aAAO;AAAA,IACX;AACA,UAAM,kBAA0B,QAAQ,gBAAgB;AACxD,QAAI,oBAAoB,kBAAkB;AACtC,YAAM,IAAI,2BAA2B,EAAE,KAAK,CAAC;AAAA,IACjD;AACA,uBAAmB;AAAA,EACvB;AACJ;",
6
6
  "names": []
7
7
  }
@@ -32,4 +32,24 @@ export declare function GetSafeNewPath(InPath: string): Promise<string>;
32
32
  * returns `false`.
33
33
  */
34
34
  export declare function IsValidFileName(DirectoryPath: string, FileName: string, PersistNewFile?: boolean, Extension?: FFileExtension | undefined): Promise<boolean>;
35
+ /**
36
+ * Write a text file to a given {@link Path} having contents {@link Contents}.
37
+ *
38
+ * @param Path - The path of the file that will be written.
39
+ * @param Contents - The text contents of the file to write.
40
+ *
41
+ * @returns {Promise<void>} A {@link Promise} that resolves when the call to {@link Fs.writeFile} resolves.
42
+ *
43
+ * @example
44
+ * ```typescript
45
+ * import { WriteTextFile } from "@sorrell/utilities/fs";
46
+ * import { resolve } from "path";
47
+ *
48
+ * const MyReadMe: string = "# ReadMe\n\nThis package accomplishes...\n";
49
+ * const MyReadMePath: string = resolve(".");
50
+ *
51
+ * await WriteTextFile(MyReadMePath, MyReadMe);
52
+ * ```
53
+ */
54
+ export declare function WriteTextFile(Path: string, Contents: string): Promise<void>;
35
55
  //# sourceMappingURL=FileSystem.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FileSystem.d.ts","sourceRoot":"","sources":["../../../Source/FileSystem/FileSystem.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAiB5D;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,cAAc,GAAG,OAAO,CAuC3E;AAED;;;;;GAKG;AACH,wBAAsB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAqBpE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,eAAe,CACjC,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,MAAM,EAChB,cAAc,GAAE,OAAe,EAC/B,SAAS,GAAE,cAAc,GAAG,SAAqB,GAClD,OAAO,CAAC,OAAO,CAAC,CAmClB"}
1
+ {"version":3,"file":"FileSystem.d.ts","sourceRoot":"","sources":["../../../Source/FileSystem/FileSystem.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAmB5D;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,cAAc,GAAG,OAAO,CAuC3E;AAED;;;;;GAKG;AACH,wBAAsB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAqBpE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,eAAe,CACjC,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,MAAM,EAChB,cAAc,GAAE,OAAe,EAC/B,SAAS,GAAE,cAAc,GAAG,SAAqB,GAClD,OAAO,CAAC,OAAO,CAAC,CAmClB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAGjF"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @file Functional.Internal.Types.ts
3
+ * @author Gage Sorrell <gage@sorrell.sh>
4
+ * @copyright (c) 2026 Gage Sorrell
5
+ * @license MIT
6
+ */
7
+ import type { CurriedArgument } from "./Functional.Internal";
8
+ export type FCurriedArgument = typeof CurriedArgument;
9
+ //# sourceMappingURL=Functional.Internal.Types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Functional.Internal.Types.d.ts","sourceRoot":"","sources":["../../../Source/Functional/Functional.Internal.Types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,MAAM,MAAM,gBAAgB,GAAG,OAAO,eAAe,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @file Functional.Internal.ts
3
+ * @author Gage Sorrell <gage@sorrell.sh>
4
+ * @copyright (c) 2026 Gage Sorrell
5
+ * @license MIT
6
+ */
7
+ export declare const CurriedArgument: unique symbol;
8
+ //# sourceMappingURL=Functional.Internal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Functional.Internal.d.ts","sourceRoot":"","sources":["../../../Source/Functional/Functional.Internal.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,eAAe,EAAE,OAAO,MAAsC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Functional.d.ts","sourceRoot":"","sources":["../../../Source/Functional/Functional.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,GAAG,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,UAGvD"}
1
+ {"version":3,"file":"Functional.d.ts","sourceRoot":"","sources":["../../../Source/Functional/Functional.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,GAAG,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,UAGvD"}
package/License.md ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2026 Gage Sorrell
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/ReadMe.md CHANGED
@@ -1,5 +1,5 @@
1
+ *Copyright &copy; 2026 Gage Sorrell. Released under the [MIT license](./License.md).*
2
+
1
3
  # `@sorrell/utilities`
2
4
 
3
5
  **Purpose.**&ensp;This package hosts general-purpose utility functions and types.
4
-
5
-
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sorrell/utilities",
3
- "version": "1.1.60",
3
+ "version": "1.1.61",
4
4
  "private": false,
5
5
  "description": "Various TypeScript utilities.",
6
6
  "keywords": [
@@ -114,7 +114,6 @@
114
114
  "optional": true
115
115
  }
116
116
  },
117
- "main": "./Distribution/ESM/index.js",
118
117
  "types": "./Distribution/Types/index.d.ts",
119
118
  "scripts": {
120
119
  "prepublish": "npm run build",
@@ -123,13 +122,10 @@
123
122
  "build": "npm run build:js && npm run build:types"
124
123
  },
125
124
  "devDependencies": {
126
- "@rollup/plugin-node-resolve": "^16.0.3",
127
- "@rollup/plugin-typescript": "^12.3.0",
128
125
  "@types/node": "^25.6.0",
129
126
  "clipboardy": "^5.3.1",
130
127
  "esbuild": "^0.28.0",
131
128
  "package-json-type": "^1.1.2",
132
- "rollup": "^4.60.2",
133
129
  "tslib": "^2.8.1",
134
130
  "tsover": "^6.0.0",
135
131
  "tsover-runtime": "0.0.6"