@sorrell/utilities 1.2.2 → 1.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ReadMe.md +4 -0
- package/package.json +12 -3
- package/Distribution/PackageExports.Generated.json +0 -122
- package/Distribution/Types/Array/Array.Internal.Types.d.cts +0 -43
- package/Distribution/Types/Array/Array.Internal.Types.d.cts.map +0 -10
- package/Distribution/Types/Array/Array.Internal.Types.d.mts +0 -43
- package/Distribution/Types/Array/Array.Internal.Types.d.mts.map +0 -10
- package/Distribution/Types/Array/Array.Internal.Types.d.ts +0 -43
- package/Distribution/Types/Array/Array.Internal.Types.d.ts.map +0 -1
- package/Distribution/Types/Array/Array.Internal.d.cts +0 -16
- package/Distribution/Types/Array/Array.Internal.d.cts.map +0 -10
- package/Distribution/Types/Array/Array.Internal.d.mts +0 -16
- package/Distribution/Types/Array/Array.Internal.d.mts.map +0 -10
- package/Distribution/Types/Array/Array.Internal.d.ts +0 -16
- package/Distribution/Types/Array/Array.Internal.d.ts.map +0 -1
- package/Distribution/Types/Array/Array.Types.d.cts +0 -92
- package/Distribution/Types/Array/Array.Types.d.cts.map +0 -10
- package/Distribution/Types/Array/Array.Types.d.mts +0 -92
- package/Distribution/Types/Array/Array.Types.d.mts.map +0 -10
- package/Distribution/Types/Array/Array.Types.d.ts +0 -92
- package/Distribution/Types/Array/Array.Types.d.ts.map +0 -1
- package/Distribution/Types/Array/Array.d.cts +0 -33
- package/Distribution/Types/Array/Array.d.cts.map +0 -10
- package/Distribution/Types/Array/Array.d.mts +0 -33
- package/Distribution/Types/Array/Array.d.mts.map +0 -10
- package/Distribution/Types/Array/Array.d.ts +0 -33
- package/Distribution/Types/Array/Array.d.ts.map +0 -1
- package/Distribution/Types/Array/index.d.cts +0 -9
- package/Distribution/Types/Array/index.d.cts.map +0 -10
- package/Distribution/Types/Array/index.d.mts +0 -9
- package/Distribution/Types/Array/index.d.mts.map +0 -10
- package/Distribution/Types/Array/index.d.ts +0 -9
- package/Distribution/Types/Array/index.d.ts.map +0 -1
- package/Distribution/Types/Async/Async.Types.d.cts +0 -150
- package/Distribution/Types/Async/Async.Types.d.cts.map +0 -10
- package/Distribution/Types/Async/Async.Types.d.mts +0 -150
- package/Distribution/Types/Async/Async.Types.d.mts.map +0 -10
- package/Distribution/Types/Async/Async.Types.d.ts +0 -150
- package/Distribution/Types/Async/Async.Types.d.ts.map +0 -1
- package/Distribution/Types/Async/Async.d.cts +0 -145
- package/Distribution/Types/Async/Async.d.cts.map +0 -10
- package/Distribution/Types/Async/Async.d.mts +0 -145
- package/Distribution/Types/Async/Async.d.mts.map +0 -10
- package/Distribution/Types/Async/Async.d.ts +0 -145
- package/Distribution/Types/Async/Async.d.ts.map +0 -1
- package/Distribution/Types/Async/index.d.cts +0 -9
- package/Distribution/Types/Async/index.d.cts.map +0 -10
- package/Distribution/Types/Async/index.d.mts +0 -9
- package/Distribution/Types/Async/index.d.mts.map +0 -10
- package/Distribution/Types/Async/index.d.ts +0 -9
- package/Distribution/Types/Async/index.d.ts.map +0 -1
- package/Distribution/Types/Effect/Effect.Types.d.cts +0 -16
- package/Distribution/Types/Effect/Effect.Types.d.cts.map +0 -10
- package/Distribution/Types/Effect/Effect.Types.d.mts +0 -16
- package/Distribution/Types/Effect/Effect.Types.d.mts.map +0 -10
- package/Distribution/Types/Effect/Effect.Types.d.ts +0 -16
- package/Distribution/Types/Effect/Effect.Types.d.ts.map +0 -1
- package/Distribution/Types/Effect/Effect.d.cts +0 -8
- package/Distribution/Types/Effect/Effect.d.cts.map +0 -10
- package/Distribution/Types/Effect/Effect.d.mts +0 -8
- package/Distribution/Types/Effect/Effect.d.mts.map +0 -10
- package/Distribution/Types/Effect/Effect.d.ts +0 -8
- package/Distribution/Types/Effect/Effect.d.ts.map +0 -1
- package/Distribution/Types/Effect/Index.Effect.d.cts +0 -10
- package/Distribution/Types/Effect/Index.Effect.d.cts.map +0 -10
- package/Distribution/Types/Effect/Index.Effect.d.mts +0 -10
- package/Distribution/Types/Effect/Index.Effect.d.mts.map +0 -10
- package/Distribution/Types/Effect/Index.Effect.d.ts +0 -10
- package/Distribution/Types/Effect/Index.Effect.d.ts.map +0 -1
- package/Distribution/Types/Effect/index.d.cts +0 -8
- package/Distribution/Types/Effect/index.d.cts.map +0 -10
- package/Distribution/Types/Effect/index.d.mts +0 -8
- package/Distribution/Types/Effect/index.d.mts.map +0 -10
- package/Distribution/Types/Effect/index.d.ts +0 -8
- package/Distribution/Types/Effect/index.d.ts.map +0 -1
- package/Distribution/Types/FileSystem/FileSystem.Types.d.cts +0 -8
- package/Distribution/Types/FileSystem/FileSystem.Types.d.cts.map +0 -10
- package/Distribution/Types/FileSystem/FileSystem.Types.d.mts +0 -8
- package/Distribution/Types/FileSystem/FileSystem.Types.d.mts.map +0 -10
- package/Distribution/Types/FileSystem/FileSystem.Types.d.ts +0 -8
- package/Distribution/Types/FileSystem/FileSystem.Types.d.ts.map +0 -1
- package/Distribution/Types/FileSystem/FileSystem.d.cts +0 -55
- package/Distribution/Types/FileSystem/FileSystem.d.cts.map +0 -10
- package/Distribution/Types/FileSystem/FileSystem.d.mts +0 -55
- package/Distribution/Types/FileSystem/FileSystem.d.mts.map +0 -10
- package/Distribution/Types/FileSystem/FileSystem.d.ts +0 -55
- package/Distribution/Types/FileSystem/FileSystem.d.ts.map +0 -1
- package/Distribution/Types/FileSystem/index.d.cts +0 -9
- package/Distribution/Types/FileSystem/index.d.cts.map +0 -10
- package/Distribution/Types/FileSystem/index.d.mts +0 -9
- package/Distribution/Types/FileSystem/index.d.mts.map +0 -10
- package/Distribution/Types/FileSystem/index.d.ts +0 -9
- package/Distribution/Types/FileSystem/index.d.ts.map +0 -1
- package/Distribution/Types/Functional/Functional.Internal.Types.d.cts +0 -9
- package/Distribution/Types/Functional/Functional.Internal.Types.d.cts.map +0 -10
- package/Distribution/Types/Functional/Functional.Internal.Types.d.mts +0 -9
- package/Distribution/Types/Functional/Functional.Internal.Types.d.mts.map +0 -10
- package/Distribution/Types/Functional/Functional.Internal.Types.d.ts +0 -9
- package/Distribution/Types/Functional/Functional.Internal.Types.d.ts.map +0 -1
- package/Distribution/Types/Functional/Functional.Internal.d.cts +0 -8
- package/Distribution/Types/Functional/Functional.Internal.d.cts.map +0 -10
- package/Distribution/Types/Functional/Functional.Internal.d.mts +0 -8
- package/Distribution/Types/Functional/Functional.Internal.d.mts.map +0 -10
- package/Distribution/Types/Functional/Functional.Internal.d.ts +0 -8
- package/Distribution/Types/Functional/Functional.Internal.d.ts.map +0 -1
- package/Distribution/Types/Functional/Functional.Types.d.cts +0 -28
- package/Distribution/Types/Functional/Functional.Types.d.cts.map +0 -10
- package/Distribution/Types/Functional/Functional.Types.d.mts +0 -28
- package/Distribution/Types/Functional/Functional.Types.d.mts.map +0 -10
- package/Distribution/Types/Functional/Functional.Types.d.ts +0 -28
- package/Distribution/Types/Functional/Functional.Types.d.ts.map +0 -1
- package/Distribution/Types/Functional/Functional.d.cts +0 -8
- package/Distribution/Types/Functional/Functional.d.cts.map +0 -10
- package/Distribution/Types/Functional/Functional.d.mts +0 -8
- package/Distribution/Types/Functional/Functional.d.mts.map +0 -10
- package/Distribution/Types/Functional/Functional.d.ts +0 -8
- package/Distribution/Types/Functional/Functional.d.ts.map +0 -1
- package/Distribution/Types/Functional/index.d.cts +0 -9
- package/Distribution/Types/Functional/index.d.cts.map +0 -10
- package/Distribution/Types/Functional/index.d.mts +0 -9
- package/Distribution/Types/Functional/index.d.mts.map +0 -10
- package/Distribution/Types/Functional/index.d.ts +0 -9
- package/Distribution/Types/Functional/index.d.ts.map +0 -1
- package/Distribution/Types/Math/Complex.Internal.d.cts +0 -8
- package/Distribution/Types/Math/Complex.Internal.d.cts.map +0 -10
- package/Distribution/Types/Math/Complex.Internal.d.mts +0 -8
- package/Distribution/Types/Math/Complex.Internal.d.mts.map +0 -10
- package/Distribution/Types/Math/Complex.Internal.d.ts +0 -8
- package/Distribution/Types/Math/Complex.Internal.d.ts.map +0 -1
- package/Distribution/Types/Math/Complex.Types.d.cts +0 -69
- package/Distribution/Types/Math/Complex.Types.d.cts.map +0 -10
- package/Distribution/Types/Math/Complex.Types.d.mts +0 -69
- package/Distribution/Types/Math/Complex.Types.d.mts.map +0 -10
- package/Distribution/Types/Math/Complex.Types.d.ts +0 -69
- package/Distribution/Types/Math/Complex.Types.d.ts.map +0 -1
- package/Distribution/Types/Math/Complex.d.cts +0 -63
- package/Distribution/Types/Math/Complex.d.cts.map +0 -10
- package/Distribution/Types/Math/Complex.d.mts +0 -63
- package/Distribution/Types/Math/Complex.d.mts.map +0 -10
- package/Distribution/Types/Math/Complex.d.ts +0 -63
- package/Distribution/Types/Math/Complex.d.ts.map +0 -1
- package/Distribution/Types/Math/Index.Complex.d.cts +0 -9
- package/Distribution/Types/Math/Index.Complex.d.cts.map +0 -10
- package/Distribution/Types/Math/Index.Complex.d.mts +0 -9
- package/Distribution/Types/Math/Index.Complex.d.mts.map +0 -10
- package/Distribution/Types/Math/Index.Complex.d.ts +0 -9
- package/Distribution/Types/Math/Index.Complex.d.ts.map +0 -1
- package/Distribution/Types/Math/Index.Experimental.d.cts +0 -10
- package/Distribution/Types/Math/Index.Experimental.d.cts.map +0 -10
- package/Distribution/Types/Math/Index.Experimental.d.mts +0 -10
- package/Distribution/Types/Math/Index.Experimental.d.mts.map +0 -10
- package/Distribution/Types/Math/Index.Experimental.d.ts +0 -10
- package/Distribution/Types/Math/Index.Experimental.d.ts.map +0 -1
- package/Distribution/Types/Math/Math.Internal.Types.d.cts +0 -47
- package/Distribution/Types/Math/Math.Internal.Types.d.cts.map +0 -10
- package/Distribution/Types/Math/Math.Internal.Types.d.mts +0 -47
- package/Distribution/Types/Math/Math.Internal.Types.d.mts.map +0 -10
- package/Distribution/Types/Math/Math.Internal.Types.d.ts +0 -47
- package/Distribution/Types/Math/Math.Internal.Types.d.ts.map +0 -1
- package/Distribution/Types/Math/Math.Types.d.cts +0 -92
- package/Distribution/Types/Math/Math.Types.d.cts.map +0 -10
- package/Distribution/Types/Math/Math.Types.d.mts +0 -92
- package/Distribution/Types/Math/Math.Types.d.mts.map +0 -10
- package/Distribution/Types/Math/Math.Types.d.ts +0 -92
- package/Distribution/Types/Math/Math.Types.d.ts.map +0 -1
- package/Distribution/Types/Math/Math.d.cts +0 -8
- package/Distribution/Types/Math/Math.d.cts.map +0 -10
- package/Distribution/Types/Math/Math.d.mts +0 -8
- package/Distribution/Types/Math/Math.d.mts.map +0 -10
- package/Distribution/Types/Math/Math.d.ts +0 -8
- package/Distribution/Types/Math/Math.d.ts.map +0 -1
- package/Distribution/Types/Math/Vector.d.cts +0 -102
- package/Distribution/Types/Math/Vector.d.cts.map +0 -10
- package/Distribution/Types/Math/Vector.d.mts +0 -102
- package/Distribution/Types/Math/Vector.d.mts.map +0 -10
- package/Distribution/Types/Math/Vector.d.ts +0 -102
- package/Distribution/Types/Math/Vector.d.ts.map +0 -1
- package/Distribution/Types/Math/index.d.cts +0 -15
- package/Distribution/Types/Math/index.d.cts.map +0 -10
- package/Distribution/Types/Math/index.d.mts +0 -15
- package/Distribution/Types/Math/index.d.mts.map +0 -10
- package/Distribution/Types/Math/index.d.ts +0 -15
- package/Distribution/Types/Math/index.d.ts.map +0 -1
- package/Distribution/Types/Miscellaneous/Utility.Internal.d.cts +0 -8
- package/Distribution/Types/Miscellaneous/Utility.Internal.d.cts.map +0 -10
- package/Distribution/Types/Miscellaneous/Utility.Internal.d.mts +0 -8
- package/Distribution/Types/Miscellaneous/Utility.Internal.d.mts.map +0 -10
- package/Distribution/Types/Miscellaneous/Utility.Internal.d.ts +0 -8
- package/Distribution/Types/Miscellaneous/Utility.Internal.d.ts.map +0 -1
- package/Distribution/Types/Miscellaneous/Utility.Types.d.cts +0 -104
- package/Distribution/Types/Miscellaneous/Utility.Types.d.cts.map +0 -10
- package/Distribution/Types/Miscellaneous/Utility.Types.d.mts +0 -104
- package/Distribution/Types/Miscellaneous/Utility.Types.d.mts.map +0 -10
- package/Distribution/Types/Miscellaneous/Utility.Types.d.ts +0 -104
- package/Distribution/Types/Miscellaneous/Utility.Types.d.ts.map +0 -1
- package/Distribution/Types/Miscellaneous/index.d.cts +0 -8
- package/Distribution/Types/Miscellaneous/index.d.cts.map +0 -10
- package/Distribution/Types/Miscellaneous/index.d.mts +0 -8
- package/Distribution/Types/Miscellaneous/index.d.mts.map +0 -10
- package/Distribution/Types/Miscellaneous/index.d.ts +0 -8
- package/Distribution/Types/Miscellaneous/index.d.ts.map +0 -1
- package/Distribution/Types/Npm/Index.Effect.d.cts +0 -9
- package/Distribution/Types/Npm/Index.Effect.d.cts.map +0 -10
- package/Distribution/Types/Npm/Index.Effect.d.mts +0 -9
- package/Distribution/Types/Npm/Index.Effect.d.mts.map +0 -10
- package/Distribution/Types/Npm/Index.Effect.d.ts +0 -9
- package/Distribution/Types/Npm/Index.Effect.d.ts.map +0 -1
- package/Distribution/Types/Npm/Npm.Effect.Internal.d.cts +0 -17
- package/Distribution/Types/Npm/Npm.Effect.Internal.d.cts.map +0 -10
- package/Distribution/Types/Npm/Npm.Effect.Internal.d.mts +0 -17
- package/Distribution/Types/Npm/Npm.Effect.Internal.d.mts.map +0 -10
- package/Distribution/Types/Npm/Npm.Effect.Internal.d.ts +0 -17
- package/Distribution/Types/Npm/Npm.Effect.Internal.d.ts.map +0 -1
- package/Distribution/Types/Npm/Npm.Effect.Types.d.cts +0 -12
- package/Distribution/Types/Npm/Npm.Effect.Types.d.cts.map +0 -10
- package/Distribution/Types/Npm/Npm.Effect.Types.d.mts +0 -12
- package/Distribution/Types/Npm/Npm.Effect.Types.d.mts.map +0 -10
- package/Distribution/Types/Npm/Npm.Effect.Types.d.ts +0 -12
- package/Distribution/Types/Npm/Npm.Effect.Types.d.ts.map +0 -1
- package/Distribution/Types/Npm/Npm.Effect.d.cts +0 -92
- package/Distribution/Types/Npm/Npm.Effect.d.cts.map +0 -10
- package/Distribution/Types/Npm/Npm.Effect.d.mts +0 -92
- package/Distribution/Types/Npm/Npm.Effect.d.mts.map +0 -10
- package/Distribution/Types/Npm/Npm.Effect.d.ts +0 -92
- package/Distribution/Types/Npm/Npm.Effect.d.ts.map +0 -1
- package/Distribution/Types/Npm/Npm.Error.d.cts +0 -36
- package/Distribution/Types/Npm/Npm.Error.d.cts.map +0 -10
- package/Distribution/Types/Npm/Npm.Error.d.mts +0 -36
- package/Distribution/Types/Npm/Npm.Error.d.mts.map +0 -10
- package/Distribution/Types/Npm/Npm.Error.d.ts +0 -36
- package/Distribution/Types/Npm/Npm.Error.d.ts.map +0 -1
- package/Distribution/Types/Npm/Npm.d.cts +0 -91
- package/Distribution/Types/Npm/Npm.d.cts.map +0 -10
- package/Distribution/Types/Npm/Npm.d.mts +0 -91
- package/Distribution/Types/Npm/Npm.d.mts.map +0 -10
- package/Distribution/Types/Npm/Npm.d.ts +0 -91
- package/Distribution/Types/Npm/Npm.d.ts.map +0 -1
- package/Distribution/Types/Npm/index.d.cts +0 -15
- package/Distribution/Types/Npm/index.d.cts.map +0 -10
- package/Distribution/Types/Npm/index.d.mts +0 -15
- package/Distribution/Types/Npm/index.d.mts.map +0 -10
- package/Distribution/Types/Npm/index.d.ts +0 -15
- package/Distribution/Types/Npm/index.d.ts.map +0 -1
- package/Distribution/Types/Path/Path.d.cts +0 -17
- package/Distribution/Types/Path/Path.d.cts.map +0 -10
- package/Distribution/Types/Path/Path.d.mts +0 -17
- package/Distribution/Types/Path/Path.d.mts.map +0 -10
- package/Distribution/Types/Path/Path.d.ts +0 -17
- package/Distribution/Types/Path/Path.d.ts.map +0 -1
- package/Distribution/Types/Path/index.d.cts +0 -8
- package/Distribution/Types/Path/index.d.cts.map +0 -10
- package/Distribution/Types/Path/index.d.mts +0 -8
- package/Distribution/Types/Path/index.d.mts.map +0 -10
- package/Distribution/Types/Path/index.d.ts +0 -8
- package/Distribution/Types/Path/index.d.ts.map +0 -1
- package/Distribution/Types/String/String.d.cts +0 -28
- package/Distribution/Types/String/String.d.cts.map +0 -10
- package/Distribution/Types/String/String.d.mts +0 -28
- package/Distribution/Types/String/String.d.mts.map +0 -10
- package/Distribution/Types/String/String.d.ts +0 -28
- package/Distribution/Types/String/String.d.ts.map +0 -1
- package/Distribution/Types/String/index.d.cts +0 -8
- package/Distribution/Types/String/index.d.cts.map +0 -10
- package/Distribution/Types/String/index.d.mts +0 -8
- package/Distribution/Types/String/index.d.mts.map +0 -10
- package/Distribution/Types/String/index.d.ts +0 -8
- package/Distribution/Types/String/index.d.ts.map +0 -1
- package/Distribution/Types/index.d.cts +0 -24
- package/Distribution/Types/index.d.cts.map +0 -10
- package/Distribution/Types/index.d.mts +0 -24
- package/Distribution/Types/index.d.mts.map +0 -10
- package/Distribution/Types/index.d.ts +0 -24
- package/Distribution/Types/index.d.ts.map +0 -1
- package/Distribution/array.cjs +0 -51
- package/Distribution/array.cjs.map +0 -7
- package/Distribution/array.js +0 -28
- package/Distribution/array.js.map +0 -7
- package/Distribution/async.cjs +0 -174
- package/Distribution/async.cjs.map +0 -7
- package/Distribution/async.js +0 -151
- package/Distribution/async.js.map +0 -7
- package/Distribution/complex.cjs +0 -97
- package/Distribution/complex.cjs.map +0 -7
- package/Distribution/complex.js +0 -74
- package/Distribution/complex.js.map +0 -7
- package/Distribution/effect.cjs +0 -63
- package/Distribution/effect.cjs.map +0 -7
- package/Distribution/effect.js +0 -58
- package/Distribution/effect.js.map +0 -7
- package/Distribution/fs.cjs +0 -128
- package/Distribution/fs.cjs.map +0 -7
- package/Distribution/fs.js +0 -95
- package/Distribution/fs.js.map +0 -7
- package/Distribution/functional.cjs +0 -49
- package/Distribution/functional.cjs.map +0 -7
- package/Distribution/functional.js +0 -26
- package/Distribution/functional.js.map +0 -7
- package/Distribution/index.cjs +0 -701
- package/Distribution/index.cjs.map +0 -7
- package/Distribution/index.js +0 -674
- package/Distribution/index.js.map +0 -7
- package/Distribution/math.cjs +0 -243
- package/Distribution/math.cjs.map +0 -7
- package/Distribution/math.js +0 -226
- package/Distribution/math.js.map +0 -7
- package/Distribution/misc.cjs +0 -45
- package/Distribution/misc.cjs.map +0 -7
- package/Distribution/misc.js +0 -22
- package/Distribution/misc.js.map +0 -7
- package/Distribution/npm-effect.cjs +0 -130
- package/Distribution/npm-effect.cjs.map +0 -7
- package/Distribution/npm-effect.js +0 -97
- package/Distribution/npm-effect.js.map +0 -7
- package/Distribution/npm.cjs +0 -106
- package/Distribution/npm.cjs.map +0 -7
- package/Distribution/npm.js +0 -73
- package/Distribution/npm.js.map +0 -7
- package/Distribution/path.cjs +0 -63
- package/Distribution/path.cjs.map +0 -7
- package/Distribution/path.js +0 -40
- package/Distribution/path.js.map +0 -7
package/Distribution/npm.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 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,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
|
-
"names": []
|
|
7
|
-
}
|
package/Distribution/path.cjs
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// Source/Path/index.ts
|
|
21
|
-
var Path_exports = {};
|
|
22
|
-
__export(Path_exports, {
|
|
23
|
-
FPath: () => FPath
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(Path_exports);
|
|
26
|
-
|
|
27
|
-
// Source/Path/Path.ts
|
|
28
|
-
var import_path = require("path");
|
|
29
|
-
var import_tsover_runtime = require("tsover-runtime");
|
|
30
|
-
var FPath = class _FPath {
|
|
31
|
-
toString() {
|
|
32
|
-
return this.Raw;
|
|
33
|
-
}
|
|
34
|
-
constructor(Argument) {
|
|
35
|
-
if (typeof Argument === "string") {
|
|
36
|
-
this.Raw = Argument;
|
|
37
|
-
} else {
|
|
38
|
-
this.Raw = Argument.Raw;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
[import_tsover_runtime.Operator.slash](A, B) {
|
|
42
|
-
if (typeof A === "string") {
|
|
43
|
-
return new _FPath((0, import_path.join)(A, B.Raw));
|
|
44
|
-
} else if (typeof B === "string") {
|
|
45
|
-
return new _FPath((0, import_path.join)(A.Raw, B));
|
|
46
|
-
} else {
|
|
47
|
-
return new _FPath((0, import_path.join)(A.Raw, B.Raw));
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
/**
|
|
52
|
-
* @file Path.ts
|
|
53
|
-
* @author Gage Sorrell <gage@sorrell.sh>
|
|
54
|
-
* @copyright (c) 2026 Gage Sorrell
|
|
55
|
-
* @license MIT
|
|
56
|
-
*/
|
|
57
|
-
/**
|
|
58
|
-
* @file index.ts
|
|
59
|
-
* @author Gage Sorrell <gage@sorrell.sh>
|
|
60
|
-
* @copyright (c) 2026 Gage Sorrell
|
|
61
|
-
* @license MIT
|
|
62
|
-
*/
|
|
63
|
-
//# sourceMappingURL=path.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../Source/Path/index.ts", "../Source/Path/Path.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 \"./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"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACMA,kBAAqB;AACrB,4BAAyB;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,+BAAS,KAAK,EAAE,GAAmB,GAA0B;AAC1D,QAAI,OAAO,MAAM,UAAU;AACvB,aAAO,IAAI,WAAM,kBAAK,GAAI,EAAY,GAAG,CAAC;AAAA,IAC9C,WACS,OAAO,MAAM,UAAU;AAC5B,aAAO,IAAI,WAAM,kBAAM,EAAY,KAAK,CAAC,CAAC;AAAA,IAC9C,OACK;AACD,aAAO,IAAI,WAAM,kBAAM,EAAY,KAAM,EAAY,GAAG,CAAC;AAAA,IAC7D;AAAA,EACJ;AACJ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/Distribution/path.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
// Source/Path/Path.ts
|
|
2
|
-
import { join } from "path";
|
|
3
|
-
import { Operator } from "tsover-runtime";
|
|
4
|
-
var FPath = class _FPath {
|
|
5
|
-
toString() {
|
|
6
|
-
return this.Raw;
|
|
7
|
-
}
|
|
8
|
-
constructor(Argument) {
|
|
9
|
-
if (typeof Argument === "string") {
|
|
10
|
-
this.Raw = Argument;
|
|
11
|
-
} else {
|
|
12
|
-
this.Raw = Argument.Raw;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
[Operator.slash](A, B) {
|
|
16
|
-
if (typeof A === "string") {
|
|
17
|
-
return new _FPath(join(A, B.Raw));
|
|
18
|
-
} else if (typeof B === "string") {
|
|
19
|
-
return new _FPath(join(A.Raw, B));
|
|
20
|
-
} else {
|
|
21
|
-
return new _FPath(join(A.Raw, B.Raw));
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
export {
|
|
26
|
-
FPath
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* @file Path.ts
|
|
30
|
-
* @author Gage Sorrell <gage@sorrell.sh>
|
|
31
|
-
* @copyright (c) 2026 Gage Sorrell
|
|
32
|
-
* @license MIT
|
|
33
|
-
*/
|
|
34
|
-
/**
|
|
35
|
-
* @file index.ts
|
|
36
|
-
* @author Gage Sorrell <gage@sorrell.sh>
|
|
37
|
-
* @copyright (c) 2026 Gage Sorrell
|
|
38
|
-
* @license MIT
|
|
39
|
-
*/
|
|
40
|
-
//# sourceMappingURL=path.js.map
|
package/Distribution/path.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../Source/Path/Path.ts"],
|
|
4
|
-
"sourcesContent": ["/**\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"],
|
|
5
|
-
"mappings": ";AAMA,SAAS,YAAY;AACrB,SAAS,gBAAgB;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,SAAS,KAAK,EAAE,GAAmB,GAA0B;AAC1D,QAAI,OAAO,MAAM,UAAU;AACvB,aAAO,IAAI,OAAM,KAAK,GAAI,EAAY,GAAG,CAAC;AAAA,IAC9C,WACS,OAAO,MAAM,UAAU;AAC5B,aAAO,IAAI,OAAM,KAAM,EAAY,KAAK,CAAC,CAAC;AAAA,IAC9C,OACK;AACD,aAAO,IAAI,OAAM,KAAM,EAAY,KAAM,EAAY,GAAG,CAAC;AAAA,IAC7D;AAAA,EACJ;AACJ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|