@sorrell/utilities 1.2.5 → 1.2.6
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/Distribution/PackageExports.Generated.json +132 -0
- package/Distribution/Types/Array/Array.Internal.Types.d.cts +43 -0
- package/Distribution/Types/Array/Array.Internal.Types.d.cts.map +10 -0
- package/Distribution/Types/Array/Array.Internal.Types.d.mts +43 -0
- package/Distribution/Types/Array/Array.Internal.Types.d.mts.map +10 -0
- package/Distribution/Types/Array/Array.Internal.Types.d.ts +43 -0
- package/Distribution/Types/Array/Array.Internal.Types.d.ts.map +1 -0
- package/Distribution/Types/Array/Array.Internal.d.cts +16 -0
- package/Distribution/Types/Array/Array.Internal.d.cts.map +10 -0
- package/Distribution/Types/Array/Array.Internal.d.mts +16 -0
- package/Distribution/Types/Array/Array.Internal.d.mts.map +10 -0
- package/Distribution/Types/Array/Array.Internal.d.ts +16 -0
- package/Distribution/Types/Array/Array.Internal.d.ts.map +1 -0
- package/Distribution/Types/Array/Array.Types.d.cts +92 -0
- package/Distribution/Types/Array/Array.Types.d.cts.map +10 -0
- package/Distribution/Types/Array/Array.Types.d.mts +92 -0
- package/Distribution/Types/Array/Array.Types.d.mts.map +10 -0
- package/Distribution/Types/Array/Array.Types.d.ts +92 -0
- package/Distribution/Types/Array/Array.Types.d.ts.map +1 -0
- package/Distribution/Types/Array/Array.d.cts +33 -0
- package/Distribution/Types/Array/Array.d.cts.map +10 -0
- package/Distribution/Types/Array/Array.d.mts +33 -0
- package/Distribution/Types/Array/Array.d.mts.map +10 -0
- package/Distribution/Types/Array/Array.d.ts +33 -0
- package/Distribution/Types/Array/Array.d.ts.map +1 -0
- package/Distribution/Types/Array/index.d.cts +9 -0
- package/Distribution/Types/Array/index.d.cts.map +10 -0
- package/Distribution/Types/Array/index.d.mts +9 -0
- package/Distribution/Types/Array/index.d.mts.map +10 -0
- package/Distribution/Types/Array/index.d.ts +9 -0
- package/Distribution/Types/Array/index.d.ts.map +1 -0
- package/Distribution/Types/Async/Async.Types.d.cts +150 -0
- package/Distribution/Types/Async/Async.Types.d.cts.map +10 -0
- package/Distribution/Types/Async/Async.Types.d.mts +150 -0
- package/Distribution/Types/Async/Async.Types.d.mts.map +10 -0
- package/Distribution/Types/Async/Async.Types.d.ts +150 -0
- package/Distribution/Types/Async/Async.Types.d.ts.map +1 -0
- package/Distribution/Types/Async/Async.d.cts +145 -0
- package/Distribution/Types/Async/Async.d.cts.map +10 -0
- package/Distribution/Types/Async/Async.d.mts +145 -0
- package/Distribution/Types/Async/Async.d.mts.map +10 -0
- package/Distribution/Types/Async/Async.d.ts +145 -0
- package/Distribution/Types/Async/Async.d.ts.map +1 -0
- package/Distribution/Types/Async/index.d.cts +9 -0
- package/Distribution/Types/Async/index.d.cts.map +10 -0
- package/Distribution/Types/Async/index.d.mts +9 -0
- package/Distribution/Types/Async/index.d.mts.map +10 -0
- package/Distribution/Types/Async/index.d.ts +9 -0
- package/Distribution/Types/Async/index.d.ts.map +1 -0
- package/Distribution/Types/Dependency/Dependency.Internal.d.cts +9 -0
- package/Distribution/Types/Dependency/Dependency.Internal.d.cts.map +10 -0
- package/Distribution/Types/Dependency/Dependency.Internal.d.mts +9 -0
- package/Distribution/Types/Dependency/Dependency.Internal.d.mts.map +10 -0
- package/Distribution/Types/Dependency/Dependency.Internal.d.ts +9 -0
- package/Distribution/Types/Dependency/Dependency.Internal.d.ts.map +1 -0
- package/Distribution/Types/Dependency/Dependency.d.cts +65 -0
- package/Distribution/Types/Dependency/Dependency.d.cts.map +10 -0
- package/Distribution/Types/Dependency/Dependency.d.mts +65 -0
- package/Distribution/Types/Dependency/Dependency.d.mts.map +10 -0
- package/Distribution/Types/Dependency/Dependency.d.ts +65 -0
- package/Distribution/Types/Dependency/Dependency.d.ts.map +1 -0
- package/Distribution/Types/Dependency/index.d.cts +13 -0
- package/Distribution/Types/Dependency/index.d.cts.map +10 -0
- package/Distribution/Types/Dependency/index.d.mts +13 -0
- package/Distribution/Types/Dependency/index.d.mts.map +10 -0
- package/Distribution/Types/Dependency/index.d.ts +13 -0
- package/Distribution/Types/Dependency/index.d.ts.map +1 -0
- package/Distribution/Types/Effect/Effect.Types.d.cts +16 -0
- package/Distribution/Types/Effect/Effect.Types.d.cts.map +10 -0
- package/Distribution/Types/Effect/Effect.Types.d.mts +16 -0
- package/Distribution/Types/Effect/Effect.Types.d.mts.map +10 -0
- package/Distribution/Types/Effect/Effect.Types.d.ts +16 -0
- package/Distribution/Types/Effect/Effect.Types.d.ts.map +1 -0
- package/Distribution/Types/Effect/Effect.d.cts +8 -0
- package/Distribution/Types/Effect/Effect.d.cts.map +10 -0
- package/Distribution/Types/Effect/Effect.d.mts +8 -0
- package/Distribution/Types/Effect/Effect.d.mts.map +10 -0
- package/Distribution/Types/Effect/Effect.d.ts +8 -0
- package/Distribution/Types/Effect/Effect.d.ts.map +1 -0
- package/Distribution/Types/Effect/Index.Effect.d.cts +10 -0
- package/Distribution/Types/Effect/Index.Effect.d.cts.map +10 -0
- package/Distribution/Types/Effect/Index.Effect.d.mts +10 -0
- package/Distribution/Types/Effect/Index.Effect.d.mts.map +10 -0
- package/Distribution/Types/Effect/Index.Effect.d.ts +10 -0
- package/Distribution/Types/Effect/Index.Effect.d.ts.map +1 -0
- package/Distribution/Types/Effect/index.d.cts +8 -0
- package/Distribution/Types/Effect/index.d.cts.map +10 -0
- package/Distribution/Types/Effect/index.d.mts +8 -0
- package/Distribution/Types/Effect/index.d.mts.map +10 -0
- package/Distribution/Types/Effect/index.d.ts +8 -0
- package/Distribution/Types/Effect/index.d.ts.map +1 -0
- package/Distribution/Types/FileSystem/FileSystem.Types.d.cts +8 -0
- package/Distribution/Types/FileSystem/FileSystem.Types.d.cts.map +10 -0
- package/Distribution/Types/FileSystem/FileSystem.Types.d.mts +8 -0
- package/Distribution/Types/FileSystem/FileSystem.Types.d.mts.map +10 -0
- package/Distribution/Types/FileSystem/FileSystem.Types.d.ts +8 -0
- package/Distribution/Types/FileSystem/FileSystem.Types.d.ts.map +1 -0
- package/Distribution/Types/FileSystem/FileSystem.d.cts +55 -0
- package/Distribution/Types/FileSystem/FileSystem.d.cts.map +10 -0
- package/Distribution/Types/FileSystem/FileSystem.d.mts +55 -0
- package/Distribution/Types/FileSystem/FileSystem.d.mts.map +10 -0
- package/Distribution/Types/FileSystem/FileSystem.d.ts +55 -0
- package/Distribution/Types/FileSystem/FileSystem.d.ts.map +1 -0
- package/Distribution/Types/FileSystem/index.d.cts +9 -0
- package/Distribution/Types/FileSystem/index.d.cts.map +10 -0
- package/Distribution/Types/FileSystem/index.d.mts +9 -0
- package/Distribution/Types/FileSystem/index.d.mts.map +10 -0
- package/Distribution/Types/FileSystem/index.d.ts +9 -0
- package/Distribution/Types/FileSystem/index.d.ts.map +1 -0
- package/Distribution/Types/Functional/Functional.Internal.Types.d.cts +9 -0
- package/Distribution/Types/Functional/Functional.Internal.Types.d.cts.map +10 -0
- package/Distribution/Types/Functional/Functional.Internal.Types.d.mts +9 -0
- package/Distribution/Types/Functional/Functional.Internal.Types.d.mts.map +10 -0
- package/Distribution/Types/Functional/Functional.Internal.Types.d.ts +9 -0
- package/Distribution/Types/Functional/Functional.Internal.Types.d.ts.map +1 -0
- package/Distribution/Types/Functional/Functional.Internal.d.cts +8 -0
- package/Distribution/Types/Functional/Functional.Internal.d.cts.map +10 -0
- package/Distribution/Types/Functional/Functional.Internal.d.mts +8 -0
- package/Distribution/Types/Functional/Functional.Internal.d.mts.map +10 -0
- package/Distribution/Types/Functional/Functional.Internal.d.ts +8 -0
- package/Distribution/Types/Functional/Functional.Internal.d.ts.map +1 -0
- package/Distribution/Types/Functional/Functional.Types.d.cts +28 -0
- package/Distribution/Types/Functional/Functional.Types.d.cts.map +10 -0
- package/Distribution/Types/Functional/Functional.Types.d.mts +28 -0
- package/Distribution/Types/Functional/Functional.Types.d.mts.map +10 -0
- package/Distribution/Types/Functional/Functional.Types.d.ts +28 -0
- package/Distribution/Types/Functional/Functional.Types.d.ts.map +1 -0
- package/Distribution/Types/Functional/Functional.d.cts +8 -0
- package/Distribution/Types/Functional/Functional.d.cts.map +10 -0
- package/Distribution/Types/Functional/Functional.d.mts +8 -0
- package/Distribution/Types/Functional/Functional.d.mts.map +10 -0
- package/Distribution/Types/Functional/Functional.d.ts +8 -0
- package/Distribution/Types/Functional/Functional.d.ts.map +1 -0
- package/Distribution/Types/Functional/index.d.cts +9 -0
- package/Distribution/Types/Functional/index.d.cts.map +10 -0
- package/Distribution/Types/Functional/index.d.mts +9 -0
- package/Distribution/Types/Functional/index.d.mts.map +10 -0
- package/Distribution/Types/Functional/index.d.ts +9 -0
- package/Distribution/Types/Functional/index.d.ts.map +1 -0
- package/Distribution/Types/Math/Complex.Internal.d.cts +8 -0
- package/Distribution/Types/Math/Complex.Internal.d.cts.map +10 -0
- package/Distribution/Types/Math/Complex.Internal.d.mts +8 -0
- package/Distribution/Types/Math/Complex.Internal.d.mts.map +10 -0
- package/Distribution/Types/Math/Complex.Internal.d.ts +8 -0
- package/Distribution/Types/Math/Complex.Internal.d.ts.map +1 -0
- package/Distribution/Types/Math/Complex.Types.d.cts +69 -0
- package/Distribution/Types/Math/Complex.Types.d.cts.map +10 -0
- package/Distribution/Types/Math/Complex.Types.d.mts +69 -0
- package/Distribution/Types/Math/Complex.Types.d.mts.map +10 -0
- package/Distribution/Types/Math/Complex.Types.d.ts +69 -0
- package/Distribution/Types/Math/Complex.Types.d.ts.map +1 -0
- package/Distribution/Types/Math/Complex.d.cts +63 -0
- package/Distribution/Types/Math/Complex.d.cts.map +10 -0
- package/Distribution/Types/Math/Complex.d.mts +63 -0
- package/Distribution/Types/Math/Complex.d.mts.map +10 -0
- package/Distribution/Types/Math/Complex.d.ts +63 -0
- package/Distribution/Types/Math/Complex.d.ts.map +1 -0
- package/Distribution/Types/Math/Index.Complex.d.cts +9 -0
- package/Distribution/Types/Math/Index.Complex.d.cts.map +10 -0
- package/Distribution/Types/Math/Index.Complex.d.mts +9 -0
- package/Distribution/Types/Math/Index.Complex.d.mts.map +10 -0
- package/Distribution/Types/Math/Index.Complex.d.ts +9 -0
- package/Distribution/Types/Math/Index.Complex.d.ts.map +1 -0
- package/Distribution/Types/Math/Index.Experimental.d.cts +10 -0
- package/Distribution/Types/Math/Index.Experimental.d.cts.map +10 -0
- package/Distribution/Types/Math/Index.Experimental.d.mts +10 -0
- package/Distribution/Types/Math/Index.Experimental.d.mts.map +10 -0
- package/Distribution/Types/Math/Index.Experimental.d.ts +10 -0
- package/Distribution/Types/Math/Index.Experimental.d.ts.map +1 -0
- package/Distribution/Types/Math/Math.Internal.Types.d.cts +47 -0
- package/Distribution/Types/Math/Math.Internal.Types.d.cts.map +10 -0
- package/Distribution/Types/Math/Math.Internal.Types.d.mts +47 -0
- package/Distribution/Types/Math/Math.Internal.Types.d.mts.map +10 -0
- package/Distribution/Types/Math/Math.Internal.Types.d.ts +47 -0
- package/Distribution/Types/Math/Math.Internal.Types.d.ts.map +1 -0
- package/Distribution/Types/Math/Math.Types.d.cts +98 -0
- package/Distribution/Types/Math/Math.Types.d.cts.map +10 -0
- package/Distribution/Types/Math/Math.Types.d.mts +98 -0
- package/Distribution/Types/Math/Math.Types.d.mts.map +10 -0
- package/Distribution/Types/Math/Math.Types.d.ts +98 -0
- package/Distribution/Types/Math/Math.Types.d.ts.map +1 -0
- package/Distribution/Types/Math/Math.d.cts +8 -0
- package/Distribution/Types/Math/Math.d.cts.map +10 -0
- package/Distribution/Types/Math/Math.d.mts +8 -0
- package/Distribution/Types/Math/Math.d.mts.map +10 -0
- package/Distribution/Types/Math/Math.d.ts +8 -0
- package/Distribution/Types/Math/Math.d.ts.map +1 -0
- package/Distribution/Types/Math/Vector.d.cts +102 -0
- package/Distribution/Types/Math/Vector.d.cts.map +10 -0
- package/Distribution/Types/Math/Vector.d.mts +102 -0
- package/Distribution/Types/Math/Vector.d.mts.map +10 -0
- package/Distribution/Types/Math/Vector.d.ts +102 -0
- package/Distribution/Types/Math/Vector.d.ts.map +1 -0
- package/Distribution/Types/Math/index.d.cts +15 -0
- package/Distribution/Types/Math/index.d.cts.map +10 -0
- package/Distribution/Types/Math/index.d.mts +15 -0
- package/Distribution/Types/Math/index.d.mts.map +10 -0
- package/Distribution/Types/Math/index.d.ts +15 -0
- package/Distribution/Types/Math/index.d.ts.map +1 -0
- package/Distribution/Types/Miscellaneous/Utility.Internal.d.cts +9 -0
- package/Distribution/Types/Miscellaneous/Utility.Internal.d.cts.map +10 -0
- package/Distribution/Types/Miscellaneous/Utility.Internal.d.mts +9 -0
- package/Distribution/Types/Miscellaneous/Utility.Internal.d.mts.map +10 -0
- package/Distribution/Types/Miscellaneous/Utility.Internal.d.ts +9 -0
- package/Distribution/Types/Miscellaneous/Utility.Internal.d.ts.map +1 -0
- package/Distribution/Types/Miscellaneous/Utility.Types.d.cts +104 -0
- package/Distribution/Types/Miscellaneous/Utility.Types.d.cts.map +10 -0
- package/Distribution/Types/Miscellaneous/Utility.Types.d.mts +104 -0
- package/Distribution/Types/Miscellaneous/Utility.Types.d.mts.map +10 -0
- package/Distribution/Types/Miscellaneous/Utility.Types.d.ts +104 -0
- package/Distribution/Types/Miscellaneous/Utility.Types.d.ts.map +1 -0
- package/Distribution/Types/Miscellaneous/index.d.cts +8 -0
- package/Distribution/Types/Miscellaneous/index.d.cts.map +10 -0
- package/Distribution/Types/Miscellaneous/index.d.mts +8 -0
- package/Distribution/Types/Miscellaneous/index.d.mts.map +10 -0
- package/Distribution/Types/Miscellaneous/index.d.ts +8 -0
- package/Distribution/Types/Miscellaneous/index.d.ts.map +1 -0
- package/Distribution/Types/Npm/Index.Effect.d.cts +9 -0
- package/Distribution/Types/Npm/Index.Effect.d.cts.map +10 -0
- package/Distribution/Types/Npm/Index.Effect.d.mts +9 -0
- package/Distribution/Types/Npm/Index.Effect.d.mts.map +10 -0
- package/Distribution/Types/Npm/Index.Effect.d.ts +9 -0
- package/Distribution/Types/Npm/Index.Effect.d.ts.map +1 -0
- package/Distribution/Types/Npm/Npm.Effect.Internal.d.cts +17 -0
- package/Distribution/Types/Npm/Npm.Effect.Internal.d.cts.map +10 -0
- package/Distribution/Types/Npm/Npm.Effect.Internal.d.mts +17 -0
- package/Distribution/Types/Npm/Npm.Effect.Internal.d.mts.map +10 -0
- package/Distribution/Types/Npm/Npm.Effect.Internal.d.ts +17 -0
- package/Distribution/Types/Npm/Npm.Effect.Internal.d.ts.map +1 -0
- package/Distribution/Types/Npm/Npm.Effect.Types.d.cts +12 -0
- package/Distribution/Types/Npm/Npm.Effect.Types.d.cts.map +10 -0
- package/Distribution/Types/Npm/Npm.Effect.Types.d.mts +12 -0
- package/Distribution/Types/Npm/Npm.Effect.Types.d.mts.map +10 -0
- package/Distribution/Types/Npm/Npm.Effect.Types.d.ts +12 -0
- package/Distribution/Types/Npm/Npm.Effect.Types.d.ts.map +1 -0
- package/Distribution/Types/Npm/Npm.Effect.d.cts +92 -0
- package/Distribution/Types/Npm/Npm.Effect.d.cts.map +10 -0
- package/Distribution/Types/Npm/Npm.Effect.d.mts +92 -0
- package/Distribution/Types/Npm/Npm.Effect.d.mts.map +10 -0
- package/Distribution/Types/Npm/Npm.Effect.d.ts +92 -0
- package/Distribution/Types/Npm/Npm.Effect.d.ts.map +1 -0
- package/Distribution/Types/Npm/Npm.Error.d.cts +36 -0
- package/Distribution/Types/Npm/Npm.Error.d.cts.map +10 -0
- package/Distribution/Types/Npm/Npm.Error.d.mts +36 -0
- package/Distribution/Types/Npm/Npm.Error.d.mts.map +10 -0
- package/Distribution/Types/Npm/Npm.Error.d.ts +36 -0
- package/Distribution/Types/Npm/Npm.Error.d.ts.map +1 -0
- package/Distribution/Types/Npm/Npm.d.cts +91 -0
- package/Distribution/Types/Npm/Npm.d.cts.map +10 -0
- package/Distribution/Types/Npm/Npm.d.mts +91 -0
- package/Distribution/Types/Npm/Npm.d.mts.map +10 -0
- package/Distribution/Types/Npm/Npm.d.ts +91 -0
- package/Distribution/Types/Npm/Npm.d.ts.map +1 -0
- package/Distribution/Types/Npm/index.d.cts +15 -0
- package/Distribution/Types/Npm/index.d.cts.map +10 -0
- package/Distribution/Types/Npm/index.d.mts +15 -0
- package/Distribution/Types/Npm/index.d.mts.map +10 -0
- package/Distribution/Types/Npm/index.d.ts +15 -0
- package/Distribution/Types/Npm/index.d.ts.map +1 -0
- package/Distribution/Types/Path/Path.d.cts +17 -0
- package/Distribution/Types/Path/Path.d.cts.map +10 -0
- package/Distribution/Types/Path/Path.d.mts +17 -0
- package/Distribution/Types/Path/Path.d.mts.map +10 -0
- package/Distribution/Types/Path/Path.d.ts +17 -0
- package/Distribution/Types/Path/Path.d.ts.map +1 -0
- package/Distribution/Types/Path/index.d.cts +8 -0
- package/Distribution/Types/Path/index.d.cts.map +10 -0
- package/Distribution/Types/Path/index.d.mts +8 -0
- package/Distribution/Types/Path/index.d.mts.map +10 -0
- package/Distribution/Types/Path/index.d.ts +8 -0
- package/Distribution/Types/Path/index.d.ts.map +1 -0
- package/Distribution/Types/Record/Record.Internal.Types.d.cts +32 -0
- package/Distribution/Types/Record/Record.Internal.Types.d.cts.map +10 -0
- package/Distribution/Types/Record/Record.Internal.Types.d.mts +32 -0
- package/Distribution/Types/Record/Record.Internal.Types.d.mts.map +10 -0
- package/Distribution/Types/Record/Record.Internal.Types.d.ts +32 -0
- package/Distribution/Types/Record/Record.Internal.Types.d.ts.map +1 -0
- package/Distribution/Types/Record/Record.Types.d.cts +78 -0
- package/Distribution/Types/Record/Record.Types.d.cts.map +10 -0
- package/Distribution/Types/Record/Record.Types.d.mts +78 -0
- package/Distribution/Types/Record/Record.Types.d.mts.map +10 -0
- package/Distribution/Types/Record/Record.Types.d.ts +78 -0
- package/Distribution/Types/Record/Record.Types.d.ts.map +1 -0
- package/Distribution/Types/Record/Record.d.cts +63 -0
- package/Distribution/Types/Record/Record.d.cts.map +10 -0
- package/Distribution/Types/Record/Record.d.mts +63 -0
- package/Distribution/Types/Record/Record.d.mts.map +10 -0
- package/Distribution/Types/Record/Record.d.ts +63 -0
- package/Distribution/Types/Record/Record.d.ts.map +1 -0
- package/Distribution/Types/Record/index.d.cts +9 -0
- package/Distribution/Types/Record/index.d.cts.map +10 -0
- package/Distribution/Types/Record/index.d.mts +9 -0
- package/Distribution/Types/Record/index.d.mts.map +10 -0
- package/Distribution/Types/Record/index.d.ts +9 -0
- package/Distribution/Types/Record/index.d.ts.map +1 -0
- package/Distribution/Types/String/String.d.cts +28 -0
- package/Distribution/Types/String/String.d.cts.map +10 -0
- package/Distribution/Types/String/String.d.mts +28 -0
- package/Distribution/Types/String/String.d.mts.map +10 -0
- package/Distribution/Types/String/String.d.ts +28 -0
- package/Distribution/Types/String/String.d.ts.map +1 -0
- package/Distribution/Types/String/index.d.cts +8 -0
- package/Distribution/Types/String/index.d.cts.map +10 -0
- package/Distribution/Types/String/index.d.mts +8 -0
- package/Distribution/Types/String/index.d.mts.map +10 -0
- package/Distribution/Types/String/index.d.ts +8 -0
- package/Distribution/Types/String/index.d.ts.map +1 -0
- package/Distribution/Types/index.d.cts +24 -0
- package/Distribution/Types/index.d.cts.map +10 -0
- package/Distribution/Types/index.d.mts +24 -0
- package/Distribution/Types/index.d.mts.map +10 -0
- package/Distribution/Types/index.d.ts +24 -0
- package/Distribution/Types/index.d.ts.map +1 -0
- package/Distribution/array.cjs +51 -0
- package/Distribution/array.cjs.map +7 -0
- package/Distribution/array.js +28 -0
- package/Distribution/array.js.map +7 -0
- package/Distribution/async.cjs +174 -0
- package/Distribution/async.cjs.map +7 -0
- package/Distribution/async.js +151 -0
- package/Distribution/async.js.map +7 -0
- package/Distribution/complex.cjs +97 -0
- package/Distribution/complex.cjs.map +7 -0
- package/Distribution/complex.js +74 -0
- package/Distribution/complex.js.map +7 -0
- package/Distribution/effect.cjs +63 -0
- package/Distribution/effect.cjs.map +7 -0
- package/Distribution/effect.js +58 -0
- package/Distribution/effect.js.map +7 -0
- package/Distribution/fs.cjs +128 -0
- package/Distribution/fs.cjs.map +7 -0
- package/Distribution/fs.js +95 -0
- package/Distribution/fs.js.map +7 -0
- package/Distribution/functional.cjs +49 -0
- package/Distribution/functional.cjs.map +7 -0
- package/Distribution/functional.js +26 -0
- package/Distribution/functional.js.map +7 -0
- package/Distribution/index.cjs +701 -0
- package/Distribution/index.cjs.map +7 -0
- package/Distribution/index.js +674 -0
- package/Distribution/index.js.map +7 -0
- package/Distribution/math.cjs +243 -0
- package/Distribution/math.cjs.map +7 -0
- package/Distribution/math.js +226 -0
- package/Distribution/math.js.map +7 -0
- package/Distribution/misc.cjs +45 -0
- package/Distribution/misc.cjs.map +7 -0
- package/Distribution/misc.js +22 -0
- package/Distribution/misc.js.map +7 -0
- package/Distribution/npm-effect.cjs +130 -0
- package/Distribution/npm-effect.cjs.map +7 -0
- package/Distribution/npm-effect.js +97 -0
- package/Distribution/npm-effect.js.map +7 -0
- package/Distribution/npm.cjs +106 -0
- package/Distribution/npm.cjs.map +7 -0
- package/Distribution/npm.js +73 -0
- package/Distribution/npm.js.map +7 -0
- package/Distribution/path.cjs +63 -0
- package/Distribution/path.cjs.map +7 -0
- package/Distribution/path.js +40 -0
- package/Distribution/path.js.map +7 -0
- package/Distribution/record.cjs +116 -0
- package/Distribution/record.cjs.map +7 -0
- package/Distribution/record.js +93 -0
- package/Distribution/record.js.map +7 -0
- package/package.json +11 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../Source/Math/Index.Complex.ts", "../Source/Math/Complex.Internal.ts", "../Source/Math/Complex.ts", "../Source/Math/Vector.ts", "../Source/Math/Math.ts"],
|
|
4
|
+
"sourcesContent": ["/**\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 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 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 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"],
|
|
5
|
+
"mappings": ";;;;;;;AAAA;AAAA;AAAA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,KAAK;AAAA,IACrE;AACA,WAAOA,UAAS;AAAA,EACpB;AAAA,EACA,IAAW,SAAiB;AACxB,WAAO,KAAK,KAAM,KAAK,KAAK,IAAM,KAAK,KAAK,IAAM,KAAK,KAAK,CAAE;AAAA,EAClE;AAAA,EACA,IAAW,SAAiB;AACxB,WAAO,KAAK;AAAA,EAChB;AACJ;;;AC9IO,IAAM,uBAAsC;",
|
|
6
|
+
"names": ["Operator"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
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/Miscellaneous/index.ts
|
|
21
|
+
var Miscellaneous_exports = {};
|
|
22
|
+
__export(Miscellaneous_exports, {
|
|
23
|
+
AbstractMethodCallError: () => AbstractMethodCallError
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(Miscellaneous_exports);
|
|
26
|
+
|
|
27
|
+
// Source/Miscellaneous/Utility.Types.ts
|
|
28
|
+
var AbstractMethodCallError = class extends Error {
|
|
29
|
+
constructor(ClassName) {
|
|
30
|
+
super(ClassName);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* @file Utility.Types.ts
|
|
35
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
36
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
37
|
+
* @license MIT
|
|
38
|
+
*/
|
|
39
|
+
/**
|
|
40
|
+
* @file index.ts
|
|
41
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
42
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
43
|
+
* @license MIT
|
|
44
|
+
*/
|
|
45
|
+
//# sourceMappingURL=misc.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../Source/Miscellaneous/index.ts", "../Source/Miscellaneous/Utility.Types.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * @file index.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nexport * from \"./Utility.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 { NoOptions } from \"./Utility.Internal.ts\";\nimport type TypeScript from \"typescript\";\n/**\n * @deprecated Use {@link TMutable} instead.\n *\n * Defines a type that corresponds to {@link RecordLike}, such that every\n * `readonly` modifier is removed, recursively.\n *\n * @template RecordLike - The type to make writeable.\n */\nexport type TDeepWriteable<RecordLike> = {\n -readonly [Key in keyof RecordLike]: TDeepWriteable<RecordLike[Key]>;\n};\n/**\n * Defines a type that corresponds to {@link RecordLike}, such that every\n * `readonly` modifier is removed, recursively.\n *\n * @template RecordLike - The type to make writeable.\n * @template ShallowOption - Whether the `readonly` modifier should be stripped recursively.\n * If `true` (the default), then only the properties of the given type will have the `readonly`\n * modifier stripped (that is, if any of these properties is a {@link Record} type with `readonly`\n * modifiers, then those will *not* be removed if {@link ShallowOption} is `true`).\n */\nexport type TMutable<RecordLike, ShallowOption extends boolean = true> = ShallowOption extends false ? {\n -readonly [Key in keyof RecordLike]: RecordLike[Key];\n} : ShallowOption extends true ? {\n -readonly [Key in keyof RecordLike]: TMutable<RecordLike[Key]>;\n} : never;\n/**\n * Given a {@link RecordLike | record-like type}, this type is the union\n * of the values of all properties in the {@link RecordLike | record-like type}.\n *\n * @template RecordLike - The record-like type from which this type extracts value types.\n */\nexport type TValues<RecordLike> = RecordLike[keyof RecordLike];\n/**\n * The element type of the return value of `Object.entries()`.\n *\n * @template RecordLike - The record-like type of the argument of `Object.entries()`.\n * @template KeyType - The subset of keys used by this type.\n */\nexport type TEntry<RecordLike, KeyType extends keyof RecordLike = keyof RecordLike> = [\n KeyType,\n RecordLike[KeyType]\n];\n/** The type used in `OptionsType`s when no options are specified. */\nexport type NoOptions = typeof NoOptions;\n/**\n * Define options for a given type as a union of `unique symbol` types.\n * All options must be *optional* by the type that uses these options.\n * The type that uses these options should have a type parameter `OptionsType`\n * defined with `OptionsType extends TOptions = NoOptions`. You will have to import\n * {@link NoOptions}, but this should be done anyway, since making all options types\n * optional should be optional. For this reason {@link NoOptions} is exported from the\n * same module as this type.\n *\n * @template OptionsType - The `unique symbol` types that act as options.\n *\n * @example * See the {@link Array.Options:type} type as an example.\n */\nexport type TOptions<OptionsType extends symbol = NoOptions> = OptionsType | NoOptions;\nexport type TNullable<Type> = Type | null | undefined;\n/** An error that is thrown in default implementations of `abstract` `class`es. */\nexport class AbstractMethodCallError extends Error {\n public constructor(ClassName?: string) {\n super(ClassName);\n }\n}\n/** The type corresponding to the schema of `tsconfig.json`. */\nexport interface FTsConfig {\n extends?: string | Array<string>;\n files?: Array<string>;\n include?: Array<string>;\n exclude?: Array<string>;\n references?: Array<TypeScript.ProjectReference>;\n compilerOptions?: FCompilerOptions;\n watchOptions?: TypeScript.WatchOptions;\n typeAcquisition?: TypeScript.TypeAcquisition;\n compileOnSave?: boolean;\n}\ntype FOverriddenCompilerOptions = \"jsx\" | \"lib\" | \"module\" | \"moduleResolution\" | \"target\";\ntype FCompilerOptions = Omit<TypeScript.server.protocol.CompilerOptions, FOverriddenCompilerOptions> & Partial<{\n jsx: JsxEmit;\n lib: Array<string>;\n module: FModuleKind;\n moduleResolution: FModuleResolutionKind;\n target: FTarget;\n}>;\ntype JsxEmit = \"none\" | \"preserve\" | \"react-native\" | \"react\" | \"react-jsx\" | \"react-jsxdev\";\ntype FModuleKind = \"none\" | \"commonjs\" | \"amd\" | \"umd\" | \"system\" | \"es6\" | \"es2015\" | \"es2020\" | \"es2022\" | \"esnext\" | \"node16\" | \"node18\" | \"node20\" | \"nodenext\" | \"preserve\";\ntype FModuleResolutionKind = \"classic\" | \"node\" | \"node\" | \"node10\" | \"node16\" | \"nodenext\" | \"bundler\";\ntype FTarget = \"es3\" | \"es5\" | \"es6\" | \"es2015\" | \"es2016\" | \"es2017\" | \"es2018\" | \"es2019\" | \"es2020\" | \"es2021\" | \"es2022\" | \"es2023\" | \"es2024\" | \"es2025\" | \"esnext\" | \"json\" | \"esnext\" | \"es2025\";\n/**\n * Maps a given {@link RecordLike} type to an identical {@link Record} type, but\n * the properties are wrapped with {@link NonNullable}.\n *\n * @template RecordLike - The `Record`-like type from which this type is defined.\n */\nexport type TRecordNonNullable<RecordLike> = {\n [Key in keyof RecordLike]: NonNullable<RecordLike[Key]>;\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACqEO,IAAM,0BAAN,cAAsC,MAAM;AAAA,EACxC,YAAY,WAAoB;AACnC,UAAM,SAAS;AAAA,EACnB;AACJ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Source/Miscellaneous/Utility.Types.ts
|
|
2
|
+
var AbstractMethodCallError = class extends Error {
|
|
3
|
+
constructor(ClassName) {
|
|
4
|
+
super(ClassName);
|
|
5
|
+
}
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
AbstractMethodCallError
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* @file Utility.Types.ts
|
|
12
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
13
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
14
|
+
* @license MIT
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* @file index.ts
|
|
18
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
19
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
20
|
+
* @license MIT
|
|
21
|
+
*/
|
|
22
|
+
//# sourceMappingURL=misc.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../Source/Miscellaneous/Utility.Types.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * @file Utility.Types.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nimport type { NoOptions } from \"./Utility.Internal.ts\";\nimport type TypeScript from \"typescript\";\n/**\n * @deprecated Use {@link TMutable} instead.\n *\n * Defines a type that corresponds to {@link RecordLike}, such that every\n * `readonly` modifier is removed, recursively.\n *\n * @template RecordLike - The type to make writeable.\n */\nexport type TDeepWriteable<RecordLike> = {\n -readonly [Key in keyof RecordLike]: TDeepWriteable<RecordLike[Key]>;\n};\n/**\n * Defines a type that corresponds to {@link RecordLike}, such that every\n * `readonly` modifier is removed, recursively.\n *\n * @template RecordLike - The type to make writeable.\n * @template ShallowOption - Whether the `readonly` modifier should be stripped recursively.\n * If `true` (the default), then only the properties of the given type will have the `readonly`\n * modifier stripped (that is, if any of these properties is a {@link Record} type with `readonly`\n * modifiers, then those will *not* be removed if {@link ShallowOption} is `true`).\n */\nexport type TMutable<RecordLike, ShallowOption extends boolean = true> = ShallowOption extends false ? {\n -readonly [Key in keyof RecordLike]: RecordLike[Key];\n} : ShallowOption extends true ? {\n -readonly [Key in keyof RecordLike]: TMutable<RecordLike[Key]>;\n} : never;\n/**\n * Given a {@link RecordLike | record-like type}, this type is the union\n * of the values of all properties in the {@link RecordLike | record-like type}.\n *\n * @template RecordLike - The record-like type from which this type extracts value types.\n */\nexport type TValues<RecordLike> = RecordLike[keyof RecordLike];\n/**\n * The element type of the return value of `Object.entries()`.\n *\n * @template RecordLike - The record-like type of the argument of `Object.entries()`.\n * @template KeyType - The subset of keys used by this type.\n */\nexport type TEntry<RecordLike, KeyType extends keyof RecordLike = keyof RecordLike> = [\n KeyType,\n RecordLike[KeyType]\n];\n/** The type used in `OptionsType`s when no options are specified. */\nexport type NoOptions = typeof NoOptions;\n/**\n * Define options for a given type as a union of `unique symbol` types.\n * All options must be *optional* by the type that uses these options.\n * The type that uses these options should have a type parameter `OptionsType`\n * defined with `OptionsType extends TOptions = NoOptions`. You will have to import\n * {@link NoOptions}, but this should be done anyway, since making all options types\n * optional should be optional. For this reason {@link NoOptions} is exported from the\n * same module as this type.\n *\n * @template OptionsType - The `unique symbol` types that act as options.\n *\n * @example * See the {@link Array.Options:type} type as an example.\n */\nexport type TOptions<OptionsType extends symbol = NoOptions> = OptionsType | NoOptions;\nexport type TNullable<Type> = Type | null | undefined;\n/** An error that is thrown in default implementations of `abstract` `class`es. */\nexport class AbstractMethodCallError extends Error {\n public constructor(ClassName?: string) {\n super(ClassName);\n }\n}\n/** The type corresponding to the schema of `tsconfig.json`. */\nexport interface FTsConfig {\n extends?: string | Array<string>;\n files?: Array<string>;\n include?: Array<string>;\n exclude?: Array<string>;\n references?: Array<TypeScript.ProjectReference>;\n compilerOptions?: FCompilerOptions;\n watchOptions?: TypeScript.WatchOptions;\n typeAcquisition?: TypeScript.TypeAcquisition;\n compileOnSave?: boolean;\n}\ntype FOverriddenCompilerOptions = \"jsx\" | \"lib\" | \"module\" | \"moduleResolution\" | \"target\";\ntype FCompilerOptions = Omit<TypeScript.server.protocol.CompilerOptions, FOverriddenCompilerOptions> & Partial<{\n jsx: JsxEmit;\n lib: Array<string>;\n module: FModuleKind;\n moduleResolution: FModuleResolutionKind;\n target: FTarget;\n}>;\ntype JsxEmit = \"none\" | \"preserve\" | \"react-native\" | \"react\" | \"react-jsx\" | \"react-jsxdev\";\ntype FModuleKind = \"none\" | \"commonjs\" | \"amd\" | \"umd\" | \"system\" | \"es6\" | \"es2015\" | \"es2020\" | \"es2022\" | \"esnext\" | \"node16\" | \"node18\" | \"node20\" | \"nodenext\" | \"preserve\";\ntype FModuleResolutionKind = \"classic\" | \"node\" | \"node\" | \"node10\" | \"node16\" | \"nodenext\" | \"bundler\";\ntype FTarget = \"es3\" | \"es5\" | \"es6\" | \"es2015\" | \"es2016\" | \"es2017\" | \"es2018\" | \"es2019\" | \"es2020\" | \"es2021\" | \"es2022\" | \"es2023\" | \"es2024\" | \"es2025\" | \"esnext\" | \"json\" | \"esnext\" | \"es2025\";\n/**\n * Maps a given {@link RecordLike} type to an identical {@link Record} type, but\n * the properties are wrapped with {@link NonNullable}.\n *\n * @template RecordLike - The `Record`-like type from which this type is defined.\n */\nexport type TRecordNonNullable<RecordLike> = {\n [Key in keyof RecordLike]: NonNullable<RecordLike[Key]>;\n};\n"],
|
|
5
|
+
"mappings": ";AAqEO,IAAM,0BAAN,cAAsC,MAAM;AAAA,EACxC,YAAY,WAAoB;AACnC,UAAM,SAAS;AAAA,EACnB;AACJ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// Source/Npm/Index.Effect.ts
|
|
31
|
+
var Index_Effect_exports = {};
|
|
32
|
+
__export(Index_Effect_exports, {
|
|
33
|
+
GetPackageJson: () => GetPackageJson,
|
|
34
|
+
GetPackageRootDirectory: () => GetPackageRootDirectory
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(Index_Effect_exports);
|
|
37
|
+
|
|
38
|
+
// Source/Npm/Npm.Effect.ts
|
|
39
|
+
var import_fs = require("fs");
|
|
40
|
+
|
|
41
|
+
// Source/Npm/Npm.Error.ts
|
|
42
|
+
var import_effect = require("effect");
|
|
43
|
+
var PackageJsonParseError = class extends import_effect.Data.TaggedError("PackageJsonParseError") {
|
|
44
|
+
};
|
|
45
|
+
var RootDirectoryNotFoundError = class extends import_effect.Data.TaggedError("RootDirectoryNotFound") {
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
// Source/Npm/Npm.Effect.ts
|
|
49
|
+
var import_path = require("path");
|
|
50
|
+
var import_effect2 = require("effect");
|
|
51
|
+
|
|
52
|
+
// Source/Npm/Npm.Effect.Internal.ts
|
|
53
|
+
function HasErrorCode(Value) {
|
|
54
|
+
return typeof Value === "object" && Value !== null && "code" in Value && typeof Value.code === "string";
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Source/Npm/Npm.Effect.ts
|
|
58
|
+
var import_process = __toESM(require("process"), 1);
|
|
59
|
+
function GetPackageJson(Path) {
|
|
60
|
+
return import_effect2.Effect.gen(function* () {
|
|
61
|
+
const RootDirectory = yield* GetPackageRootDirectory(Path);
|
|
62
|
+
const PackageJsonPath = (0, import_path.join)(RootDirectory, "package.json");
|
|
63
|
+
const FileContents = yield* import_effect2.Effect.tryPromise({
|
|
64
|
+
catch: (Cause) => Cause,
|
|
65
|
+
try: () => import_fs.promises.readFile(PackageJsonPath, "utf-8")
|
|
66
|
+
}).pipe(import_effect2.Effect.catchAll((Cause) => import_effect2.Effect.die(Cause)));
|
|
67
|
+
const PackageJson = yield* import_effect2.Effect.try({
|
|
68
|
+
catch: (Cause) => new PackageJsonParseError({
|
|
69
|
+
Cause,
|
|
70
|
+
Path: PackageJsonPath
|
|
71
|
+
}),
|
|
72
|
+
try: () => JSON.parse(FileContents)
|
|
73
|
+
});
|
|
74
|
+
return PackageJson;
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function GetPackageRootDirectory(Path) {
|
|
78
|
+
return import_effect2.Effect.gen(function* () {
|
|
79
|
+
let CurrentDirectory = yield* import_effect2.Effect.tryPromise({
|
|
80
|
+
catch: (Cause) => Cause,
|
|
81
|
+
try: () => import_fs.promises.realpath(Path ?? import_process.default.cwd())
|
|
82
|
+
}).pipe(import_effect2.Effect.catchAll((Cause) => import_effect2.Effect.die(Cause)));
|
|
83
|
+
while (true) {
|
|
84
|
+
const PackageJsonPath = (0, import_path.join)(CurrentDirectory, "package.json");
|
|
85
|
+
const PackageJsonExists = yield* import_effect2.Effect.tryPromise({
|
|
86
|
+
catch: (Cause) => Cause,
|
|
87
|
+
try: () => import_fs.promises.access(PackageJsonPath, import_fs.constants.F_OK)
|
|
88
|
+
}).pipe(import_effect2.Effect.as(true), import_effect2.Effect.catchIf((Cause) => HasErrorCode(Cause) && Cause.code === "ENOENT", () => import_effect2.Effect.succeed(false)), import_effect2.Effect.catchAll((Cause) => import_effect2.Effect.die(Cause)));
|
|
89
|
+
if (PackageJsonExists) {
|
|
90
|
+
return CurrentDirectory;
|
|
91
|
+
}
|
|
92
|
+
const ParentDirectory = (0, import_path.dirname)(CurrentDirectory);
|
|
93
|
+
if (ParentDirectory === CurrentDirectory) {
|
|
94
|
+
return yield* import_effect2.Effect.fail(new RootDirectoryNotFoundError({ Path }));
|
|
95
|
+
}
|
|
96
|
+
CurrentDirectory = ParentDirectory;
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* @file Npm.Error.ts
|
|
102
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
103
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
104
|
+
* @license MIT
|
|
105
|
+
*/
|
|
106
|
+
/**
|
|
107
|
+
* @file Npm.Effect.Internal.ts
|
|
108
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
109
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
110
|
+
* @license MIT
|
|
111
|
+
*/
|
|
112
|
+
/**
|
|
113
|
+
* @file Npm.Effect.ts
|
|
114
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
115
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
116
|
+
* @license MIT
|
|
117
|
+
*/
|
|
118
|
+
/**
|
|
119
|
+
* @file Npm.Effect.Types.ts
|
|
120
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
121
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
122
|
+
* @license MIT
|
|
123
|
+
*/
|
|
124
|
+
/**
|
|
125
|
+
* @file Index.Effect.ts
|
|
126
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
127
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
128
|
+
* @license MIT
|
|
129
|
+
*/
|
|
130
|
+
//# sourceMappingURL=npm-effect.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../Source/Npm/Index.Effect.ts", "../Source/Npm/Npm.Effect.ts", "../Source/Npm/Npm.Error.ts", "../Source/Npm/Npm.Effect.Internal.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * @file Index.Effect.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nexport * from \"./Npm.Effect.ts\";\nexport * from \"./Npm.Effect.Types.ts\";\n", "/**\n * @file Npm.Effect.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nimport type { EGetPackageJson, EGetPackageRootDirectory } from \"./Npm.Effect.Types.ts\";\nimport { promises as Fs, constants as FsConstants } from \"fs\";\nimport { PackageJsonParseError, RootDirectoryNotFoundError } from \"./Npm.Error.ts\";\nimport { dirname, join } from \"path\";\nimport { Effect } from \"effect\";\nimport { HasErrorCode } from \"./Npm.Effect.Internal.ts\";\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 * @returns {EGetPackageJson} An Effect that succeeds with the parsed `package.json`, or fails\n * with {@link RootDirectoryNotFoundError} or {@link PackageJsonParseError}.\n *\n * @example\n * Suppose `process.cwd() === \"./MyPackage\"`,\n * ```typescript\n * Effect.gen(function* ()\n * {\n * const PackageJson: IPackageJson = yield* GetPackageJson();\n * // `PackageJson` <- *The parsed `package.json` of `MyPackage`.*\n * }\n * ```\n */\nexport function GetPackageJson(Path?: string): EGetPackageJson {\n return Effect.gen(function* () {\n const RootDirectory: string = yield* GetPackageRootDirectory(Path);\n const PackageJsonPath: string = join(RootDirectory, \"package.json\");\n const FileContents: string = yield* Effect.tryPromise({\n catch: (Cause: unknown) => Cause,\n try: () => Fs.readFile(PackageJsonPath, \"utf-8\")\n }).pipe(Effect.catchAll((Cause: unknown) => Effect.die(Cause)));\n const PackageJson: IPackageJson = yield* Effect.try({\n catch: (Cause: unknown) => new PackageJsonParseError({\n Cause,\n Path: PackageJsonPath\n }),\n try: () => JSON.parse(FileContents) as IPackageJson\n });\n return PackageJson;\n });\n}\n/**\n * Get the root directory of the Node.js project in which the\n * current working directory resides.\n *\n * @param Path - *(Optional)* The given path from which to look for a root directory.\n *\n * @returns {EGetPackageRootDirectory} An Effect that succeeds with the package root\n * directory, or fails with {@link RootDirectoryNotFoundError}.\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 * import { Effect } from \"effect\";\n * const Root: string = await Effect.runPromise(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 * import { Effect } from \"effect\";\n * const TestPath: string = \"/home/alex/Documents\";\n * let Root: string | undefined = undefined;\n * try\n * {\n * Root = await Effect.runPromise(\n * GetPackageRootDirectory(TestPath)\n * );\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 * import { Effect } from \"effect\";\n * let Root: string | undefined = undefined;\n * try\n * {\n * Root = await Effect.runPromise(GetPackageRootDirectory());\n * }\n * catch (Error: unknown)\n * {\n * // `Error instanceof RootDirectoryNotFound`\n * }\n * // `Root` <- `undefined`\n * ```\n */\nexport function GetPackageRootDirectory(Path?: string): EGetPackageRootDirectory {\n return Effect.gen(function* () {\n let CurrentDirectory: string = yield* Effect.tryPromise({\n catch: (Cause: unknown) => Cause,\n try: () => Fs.realpath(Path ?? Process.cwd())\n }).pipe(Effect.catchAll((Cause: unknown) => Effect.die(Cause)));\n while (true) {\n const PackageJsonPath: string = join(CurrentDirectory, \"package.json\");\n const PackageJsonExists: boolean = yield* Effect.tryPromise({\n catch: (Cause: unknown) => Cause,\n try: () => Fs.access(PackageJsonPath, FsConstants.F_OK)\n }).pipe(Effect.as(true), Effect.catchIf((Cause: unknown): Cause is {\n readonly code: string;\n } => HasErrorCode(Cause) && Cause.code === \"ENOENT\", () => Effect.succeed(false)), Effect.catchAll((Cause: unknown) => Effect.die(Cause)));\n if (PackageJsonExists) {\n return CurrentDirectory;\n }\n const ParentDirectory: string = dirname(CurrentDirectory);\n if (ParentDirectory === CurrentDirectory) {\n return yield* Effect.fail(new RootDirectoryNotFoundError({ Path }));\n }\n CurrentDirectory = ParentDirectory;\n }\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 Npm.Effect.Internal.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\n/* eslint-disable jsdoc/require-example */\n/**\n * Returns whether a given {@link Value} contains a `readonly` `string` `\"code\"`.\n *\n * @param Value - The value to test.\n * @returns {Value is { readonly code: string }} Whether {@link Value} is a\n * `{ readonly code: string }`.\n */\nexport function HasErrorCode(Value: unknown): Value is {\n readonly code: string;\n} {\n return typeof Value === \"object\"\n && Value !== null\n && \"code\" in Value\n && typeof (Value as {\n readonly code: unknown;\n }).code === \"string\";\n}\n/* eslint-enable jsdoc/require-example */\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACOA,gBAAyD;;;ACDzD,oBAAqB;AAQd,IAAM,wBAAN,cAAoC,mBAAK,YAAY,uBAAuB,EAGhF;AACH;AAOO,IAAM,6BAAN,cAAyC,mBAAK,YAAY,uBAAuB,EAErF;AACH;;;ADnBA,kBAA8B;AAC9B,IAAAA,iBAAuB;;;AEIhB,SAAS,aAAa,OAE3B;AACE,SAAO,OAAO,UAAU,YACjB,UAAU,QACV,UAAU,SACV,OAAQ,MAER,SAAS;AACpB;;;AFVA,qBAAoB;AAoBb,SAAS,eAAe,MAAgC;AAC3D,SAAO,sBAAO,IAAI,aAAa;AAC3B,UAAM,gBAAwB,OAAO,wBAAwB,IAAI;AACjE,UAAM,sBAA0B,kBAAK,eAAe,cAAc;AAClE,UAAM,eAAuB,OAAO,sBAAO,WAAW;AAAA,MAClD,OAAO,CAAC,UAAmB;AAAA,MAC3B,KAAK,MAAM,UAAAC,SAAG,SAAS,iBAAiB,OAAO;AAAA,IACn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vB;AAAA,EACJ,CAAC;AACL;",
|
|
6
|
+
"names": ["import_effect", "Fs", "Process", "FsConstants"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
// Source/Npm/Npm.Effect.ts
|
|
2
|
+
import { promises as Fs, constants as FsConstants } from "fs";
|
|
3
|
+
|
|
4
|
+
// Source/Npm/Npm.Error.ts
|
|
5
|
+
import { Data } from "effect";
|
|
6
|
+
var PackageJsonParseError = class extends Data.TaggedError("PackageJsonParseError") {
|
|
7
|
+
};
|
|
8
|
+
var RootDirectoryNotFoundError = class extends Data.TaggedError("RootDirectoryNotFound") {
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
// Source/Npm/Npm.Effect.ts
|
|
12
|
+
import { dirname, join } from "path";
|
|
13
|
+
import { Effect } from "effect";
|
|
14
|
+
|
|
15
|
+
// Source/Npm/Npm.Effect.Internal.ts
|
|
16
|
+
function HasErrorCode(Value) {
|
|
17
|
+
return typeof Value === "object" && Value !== null && "code" in Value && typeof Value.code === "string";
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Source/Npm/Npm.Effect.ts
|
|
21
|
+
import Process from "process";
|
|
22
|
+
function GetPackageJson(Path) {
|
|
23
|
+
return Effect.gen(function* () {
|
|
24
|
+
const RootDirectory = yield* GetPackageRootDirectory(Path);
|
|
25
|
+
const PackageJsonPath = join(RootDirectory, "package.json");
|
|
26
|
+
const FileContents = yield* Effect.tryPromise({
|
|
27
|
+
catch: (Cause) => Cause,
|
|
28
|
+
try: () => Fs.readFile(PackageJsonPath, "utf-8")
|
|
29
|
+
}).pipe(Effect.catchAll((Cause) => Effect.die(Cause)));
|
|
30
|
+
const PackageJson = yield* Effect.try({
|
|
31
|
+
catch: (Cause) => new PackageJsonParseError({
|
|
32
|
+
Cause,
|
|
33
|
+
Path: PackageJsonPath
|
|
34
|
+
}),
|
|
35
|
+
try: () => JSON.parse(FileContents)
|
|
36
|
+
});
|
|
37
|
+
return PackageJson;
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
function GetPackageRootDirectory(Path) {
|
|
41
|
+
return Effect.gen(function* () {
|
|
42
|
+
let CurrentDirectory = yield* Effect.tryPromise({
|
|
43
|
+
catch: (Cause) => Cause,
|
|
44
|
+
try: () => Fs.realpath(Path ?? Process.cwd())
|
|
45
|
+
}).pipe(Effect.catchAll((Cause) => Effect.die(Cause)));
|
|
46
|
+
while (true) {
|
|
47
|
+
const PackageJsonPath = join(CurrentDirectory, "package.json");
|
|
48
|
+
const PackageJsonExists = yield* Effect.tryPromise({
|
|
49
|
+
catch: (Cause) => Cause,
|
|
50
|
+
try: () => Fs.access(PackageJsonPath, FsConstants.F_OK)
|
|
51
|
+
}).pipe(Effect.as(true), Effect.catchIf((Cause) => HasErrorCode(Cause) && Cause.code === "ENOENT", () => Effect.succeed(false)), Effect.catchAll((Cause) => Effect.die(Cause)));
|
|
52
|
+
if (PackageJsonExists) {
|
|
53
|
+
return CurrentDirectory;
|
|
54
|
+
}
|
|
55
|
+
const ParentDirectory = dirname(CurrentDirectory);
|
|
56
|
+
if (ParentDirectory === CurrentDirectory) {
|
|
57
|
+
return yield* Effect.fail(new RootDirectoryNotFoundError({ Path }));
|
|
58
|
+
}
|
|
59
|
+
CurrentDirectory = ParentDirectory;
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
export {
|
|
64
|
+
GetPackageJson,
|
|
65
|
+
GetPackageRootDirectory
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* @file Npm.Error.ts
|
|
69
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
70
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
71
|
+
* @license MIT
|
|
72
|
+
*/
|
|
73
|
+
/**
|
|
74
|
+
* @file Npm.Effect.Internal.ts
|
|
75
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
76
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
77
|
+
* @license MIT
|
|
78
|
+
*/
|
|
79
|
+
/**
|
|
80
|
+
* @file Npm.Effect.ts
|
|
81
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
82
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
83
|
+
* @license MIT
|
|
84
|
+
*/
|
|
85
|
+
/**
|
|
86
|
+
* @file Npm.Effect.Types.ts
|
|
87
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
88
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
89
|
+
* @license MIT
|
|
90
|
+
*/
|
|
91
|
+
/**
|
|
92
|
+
* @file Index.Effect.ts
|
|
93
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
94
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
95
|
+
* @license MIT
|
|
96
|
+
*/
|
|
97
|
+
//# sourceMappingURL=npm-effect.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../Source/Npm/Npm.Effect.ts", "../Source/Npm/Npm.Error.ts", "../Source/Npm/Npm.Effect.Internal.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * @file Npm.Effect.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nimport type { EGetPackageJson, EGetPackageRootDirectory } from \"./Npm.Effect.Types.ts\";\nimport { promises as Fs, constants as FsConstants } from \"fs\";\nimport { PackageJsonParseError, RootDirectoryNotFoundError } from \"./Npm.Error.ts\";\nimport { dirname, join } from \"path\";\nimport { Effect } from \"effect\";\nimport { HasErrorCode } from \"./Npm.Effect.Internal.ts\";\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 * @returns {EGetPackageJson} An Effect that succeeds with the parsed `package.json`, or fails\n * with {@link RootDirectoryNotFoundError} or {@link PackageJsonParseError}.\n *\n * @example\n * Suppose `process.cwd() === \"./MyPackage\"`,\n * ```typescript\n * Effect.gen(function* ()\n * {\n * const PackageJson: IPackageJson = yield* GetPackageJson();\n * // `PackageJson` <- *The parsed `package.json` of `MyPackage`.*\n * }\n * ```\n */\nexport function GetPackageJson(Path?: string): EGetPackageJson {\n return Effect.gen(function* () {\n const RootDirectory: string = yield* GetPackageRootDirectory(Path);\n const PackageJsonPath: string = join(RootDirectory, \"package.json\");\n const FileContents: string = yield* Effect.tryPromise({\n catch: (Cause: unknown) => Cause,\n try: () => Fs.readFile(PackageJsonPath, \"utf-8\")\n }).pipe(Effect.catchAll((Cause: unknown) => Effect.die(Cause)));\n const PackageJson: IPackageJson = yield* Effect.try({\n catch: (Cause: unknown) => new PackageJsonParseError({\n Cause,\n Path: PackageJsonPath\n }),\n try: () => JSON.parse(FileContents) as IPackageJson\n });\n return PackageJson;\n });\n}\n/**\n * Get the root directory of the Node.js project in which the\n * current working directory resides.\n *\n * @param Path - *(Optional)* The given path from which to look for a root directory.\n *\n * @returns {EGetPackageRootDirectory} An Effect that succeeds with the package root\n * directory, or fails with {@link RootDirectoryNotFoundError}.\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 * import { Effect } from \"effect\";\n * const Root: string = await Effect.runPromise(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 * import { Effect } from \"effect\";\n * const TestPath: string = \"/home/alex/Documents\";\n * let Root: string | undefined = undefined;\n * try\n * {\n * Root = await Effect.runPromise(\n * GetPackageRootDirectory(TestPath)\n * );\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 * import { Effect } from \"effect\";\n * let Root: string | undefined = undefined;\n * try\n * {\n * Root = await Effect.runPromise(GetPackageRootDirectory());\n * }\n * catch (Error: unknown)\n * {\n * // `Error instanceof RootDirectoryNotFound`\n * }\n * // `Root` <- `undefined`\n * ```\n */\nexport function GetPackageRootDirectory(Path?: string): EGetPackageRootDirectory {\n return Effect.gen(function* () {\n let CurrentDirectory: string = yield* Effect.tryPromise({\n catch: (Cause: unknown) => Cause,\n try: () => Fs.realpath(Path ?? Process.cwd())\n }).pipe(Effect.catchAll((Cause: unknown) => Effect.die(Cause)));\n while (true) {\n const PackageJsonPath: string = join(CurrentDirectory, \"package.json\");\n const PackageJsonExists: boolean = yield* Effect.tryPromise({\n catch: (Cause: unknown) => Cause,\n try: () => Fs.access(PackageJsonPath, FsConstants.F_OK)\n }).pipe(Effect.as(true), Effect.catchIf((Cause: unknown): Cause is {\n readonly code: string;\n } => HasErrorCode(Cause) && Cause.code === \"ENOENT\", () => Effect.succeed(false)), Effect.catchAll((Cause: unknown) => Effect.die(Cause)));\n if (PackageJsonExists) {\n return CurrentDirectory;\n }\n const ParentDirectory: string = dirname(CurrentDirectory);\n if (ParentDirectory === CurrentDirectory) {\n return yield* Effect.fail(new RootDirectoryNotFoundError({ Path }));\n }\n CurrentDirectory = ParentDirectory;\n }\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 Npm.Effect.Internal.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\n/* eslint-disable jsdoc/require-example */\n/**\n * Returns whether a given {@link Value} contains a `readonly` `string` `\"code\"`.\n *\n * @param Value - The value to test.\n * @returns {Value is { readonly code: string }} Whether {@link Value} is a\n * `{ readonly code: string }`.\n */\nexport function HasErrorCode(Value: unknown): Value is {\n readonly code: string;\n} {\n return typeof Value === \"object\"\n && Value !== null\n && \"code\" in Value\n && typeof (Value as {\n readonly code: unknown;\n }).code === \"string\";\n}\n/* eslint-enable jsdoc/require-example */\n"],
|
|
5
|
+
"mappings": ";AAOA,SAAS,YAAY,IAAI,aAAa,mBAAmB;;;ACDzD,SAAS,YAAY;AAQd,IAAM,wBAAN,cAAoC,KAAK,YAAY,uBAAuB,EAGhF;AACH;AAOO,IAAM,6BAAN,cAAyC,KAAK,YAAY,uBAAuB,EAErF;AACH;;;ADnBA,SAAS,SAAS,YAAY;AAC9B,SAAS,cAAc;;;AEIhB,SAAS,aAAa,OAE3B;AACE,SAAO,OAAO,UAAU,YACjB,UAAU,QACV,UAAU,SACV,OAAQ,MAER,SAAS;AACpB;;;AFVA,OAAO,aAAa;AAoBb,SAAS,eAAe,MAAgC;AAC3D,SAAO,OAAO,IAAI,aAAa;AAC3B,UAAM,gBAAwB,OAAO,wBAAwB,IAAI;AACjE,UAAM,kBAA0B,KAAK,eAAe,cAAc;AAClE,UAAM,eAAuB,OAAO,OAAO,WAAW;AAAA,MAClD,OAAO,CAAC,UAAmB;AAAA,MAC3B,KAAK,MAAM,GAAG,S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C;AACL;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// Source/Npm/index.ts
|
|
31
|
+
var Npm_exports = {};
|
|
32
|
+
__export(Npm_exports, {
|
|
33
|
+
GetPackageJson: () => GetPackageJson,
|
|
34
|
+
GetPackageRootDirectory: () => GetPackageRootDirectory,
|
|
35
|
+
PackageJsonParseError: () => PackageJsonParseError,
|
|
36
|
+
RootDirectoryNotFoundError: () => RootDirectoryNotFoundError
|
|
37
|
+
});
|
|
38
|
+
module.exports = __toCommonJS(Npm_exports);
|
|
39
|
+
|
|
40
|
+
// Source/Npm/Npm.ts
|
|
41
|
+
var import_fs = require("fs");
|
|
42
|
+
|
|
43
|
+
// Source/Npm/Npm.Error.ts
|
|
44
|
+
var import_effect = require("effect");
|
|
45
|
+
var PackageJsonParseError = class extends import_effect.Data.TaggedError("PackageJsonParseError") {
|
|
46
|
+
};
|
|
47
|
+
var RootDirectoryNotFoundError = class extends import_effect.Data.TaggedError("RootDirectoryNotFound") {
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
// Source/Npm/Npm.ts
|
|
51
|
+
var import_path = require("path");
|
|
52
|
+
var import_process = __toESM(require("process"), 1);
|
|
53
|
+
async function GetPackageJson(Path) {
|
|
54
|
+
const RootDirectory = await GetPackageRootDirectory(Path);
|
|
55
|
+
const PackageJsonPath = (0, import_path.join)(RootDirectory, "package.json");
|
|
56
|
+
const FileContents = await import_fs.promises.readFile(PackageJsonPath, "utf-8");
|
|
57
|
+
const PackageJson = await (async () => {
|
|
58
|
+
try {
|
|
59
|
+
return JSON.parse(FileContents);
|
|
60
|
+
} catch (Cause) {
|
|
61
|
+
throw new PackageJsonParseError({ Cause, Path: PackageJsonPath });
|
|
62
|
+
}
|
|
63
|
+
})();
|
|
64
|
+
return PackageJson;
|
|
65
|
+
}
|
|
66
|
+
async function GetPackageRootDirectory(Path) {
|
|
67
|
+
let CurrentDirectory = await import_fs.promises.realpath(Path ?? import_process.default.cwd());
|
|
68
|
+
while (true) {
|
|
69
|
+
const PackageJsonPath = (0, import_path.join)(CurrentDirectory, "package.json");
|
|
70
|
+
const PackageJsonExists = await (async () => {
|
|
71
|
+
try {
|
|
72
|
+
await import_fs.promises.access(PackageJsonPath, import_fs.constants.F_OK);
|
|
73
|
+
return true;
|
|
74
|
+
} catch {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
})();
|
|
78
|
+
if (PackageJsonExists) {
|
|
79
|
+
return CurrentDirectory;
|
|
80
|
+
}
|
|
81
|
+
const ParentDirectory = (0, import_path.dirname)(CurrentDirectory);
|
|
82
|
+
if (ParentDirectory === CurrentDirectory) {
|
|
83
|
+
throw new RootDirectoryNotFoundError({ Path });
|
|
84
|
+
}
|
|
85
|
+
CurrentDirectory = ParentDirectory;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* @file Npm.Error.ts
|
|
90
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
91
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
92
|
+
* @license MIT
|
|
93
|
+
*/
|
|
94
|
+
/**
|
|
95
|
+
* @file Npm.ts
|
|
96
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
97
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
98
|
+
* @license MIT
|
|
99
|
+
*/
|
|
100
|
+
/**
|
|
101
|
+
* @file index.ts
|
|
102
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
103
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
104
|
+
* @license MIT
|
|
105
|
+
*/
|
|
106
|
+
//# sourceMappingURL=npm.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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,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
|
+
"names": ["Fs", "Process", "FsConstants"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// Source/Npm/Npm.ts
|
|
2
|
+
import { promises as Fs, constants as FsConstants } from "fs";
|
|
3
|
+
|
|
4
|
+
// Source/Npm/Npm.Error.ts
|
|
5
|
+
import { Data } from "effect";
|
|
6
|
+
var PackageJsonParseError = class extends Data.TaggedError("PackageJsonParseError") {
|
|
7
|
+
};
|
|
8
|
+
var RootDirectoryNotFoundError = class extends Data.TaggedError("RootDirectoryNotFound") {
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
// Source/Npm/Npm.ts
|
|
12
|
+
import { dirname, join } from "path";
|
|
13
|
+
import Process from "process";
|
|
14
|
+
async function GetPackageJson(Path) {
|
|
15
|
+
const RootDirectory = await GetPackageRootDirectory(Path);
|
|
16
|
+
const PackageJsonPath = join(RootDirectory, "package.json");
|
|
17
|
+
const FileContents = await Fs.readFile(PackageJsonPath, "utf-8");
|
|
18
|
+
const PackageJson = await (async () => {
|
|
19
|
+
try {
|
|
20
|
+
return JSON.parse(FileContents);
|
|
21
|
+
} catch (Cause) {
|
|
22
|
+
throw new PackageJsonParseError({ Cause, Path: PackageJsonPath });
|
|
23
|
+
}
|
|
24
|
+
})();
|
|
25
|
+
return PackageJson;
|
|
26
|
+
}
|
|
27
|
+
async function GetPackageRootDirectory(Path) {
|
|
28
|
+
let CurrentDirectory = await Fs.realpath(Path ?? Process.cwd());
|
|
29
|
+
while (true) {
|
|
30
|
+
const PackageJsonPath = join(CurrentDirectory, "package.json");
|
|
31
|
+
const PackageJsonExists = await (async () => {
|
|
32
|
+
try {
|
|
33
|
+
await Fs.access(PackageJsonPath, FsConstants.F_OK);
|
|
34
|
+
return true;
|
|
35
|
+
} catch {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
})();
|
|
39
|
+
if (PackageJsonExists) {
|
|
40
|
+
return CurrentDirectory;
|
|
41
|
+
}
|
|
42
|
+
const ParentDirectory = dirname(CurrentDirectory);
|
|
43
|
+
if (ParentDirectory === CurrentDirectory) {
|
|
44
|
+
throw new RootDirectoryNotFoundError({ Path });
|
|
45
|
+
}
|
|
46
|
+
CurrentDirectory = ParentDirectory;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
export {
|
|
50
|
+
GetPackageJson,
|
|
51
|
+
GetPackageRootDirectory,
|
|
52
|
+
PackageJsonParseError,
|
|
53
|
+
RootDirectoryNotFoundError
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* @file Npm.Error.ts
|
|
57
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
58
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
59
|
+
* @license MIT
|
|
60
|
+
*/
|
|
61
|
+
/**
|
|
62
|
+
* @file Npm.ts
|
|
63
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
64
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
65
|
+
* @license MIT
|
|
66
|
+
*/
|
|
67
|
+
/**
|
|
68
|
+
* @file index.ts
|
|
69
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
70
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
71
|
+
* @license MIT
|
|
72
|
+
*/
|
|
73
|
+
//# sourceMappingURL=npm.js.map
|