@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/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
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
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
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
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/Record/index.ts
|
|
21
|
+
var Record_exports = {};
|
|
22
|
+
__export(Record_exports, {
|
|
23
|
+
FlatMapRecord: () => FlatMapRecord,
|
|
24
|
+
GetPropertyFromPath: () => GetPropertyFromPath,
|
|
25
|
+
MakeRef: () => MakeRef,
|
|
26
|
+
MapRecord: () => MapRecord,
|
|
27
|
+
SetPropertyFromPath: () => SetPropertyFromPath
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(Record_exports);
|
|
30
|
+
|
|
31
|
+
// Source/Record/Record.ts
|
|
32
|
+
function SetPropertyFromPath(InRecord, Path, Value) {
|
|
33
|
+
if (Array.isArray(Path)) {
|
|
34
|
+
throw new Error("SetPropertyFromPath does not support Array-based paths yet.");
|
|
35
|
+
}
|
|
36
|
+
const PathSplit = Path.split(".");
|
|
37
|
+
const Last = PathSplit.pop();
|
|
38
|
+
if (Last === void 0) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
if (PathSplit.length === 0) {
|
|
42
|
+
if (!Array.isArray(Path)) {
|
|
43
|
+
InRecord.Ref[Path] = Value;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
const Recurrence = (In) => {
|
|
47
|
+
const NextPropertyNameBase = PathSplit.shift();
|
|
48
|
+
if (NextPropertyNameBase !== void 0) {
|
|
49
|
+
const NextPropertyName = isNaN(parseInt(NextPropertyNameBase)) ? NextPropertyNameBase : parseInt(NextPropertyNameBase);
|
|
50
|
+
const Out = In[NextPropertyName];
|
|
51
|
+
return Recurrence(Out);
|
|
52
|
+
} else {
|
|
53
|
+
return In;
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
const PropertyRef = Recurrence(InRecord);
|
|
57
|
+
const LastTyped = isNaN(parseInt(Last)) ? Last : parseInt(Last);
|
|
58
|
+
PropertyRef.Ref[LastTyped] = Value;
|
|
59
|
+
}
|
|
60
|
+
function GetPropertyFromPath(InRecord, Path) {
|
|
61
|
+
if (Array.isArray(Path)) {
|
|
62
|
+
throw new Error("GetPropertyFromPath does not support Array-based paths yet.");
|
|
63
|
+
}
|
|
64
|
+
const PathSplit = Path.split(".");
|
|
65
|
+
const Recurrence = (In, Index = 0) => {
|
|
66
|
+
const Key = isNaN(parseInt(PathSplit[Index] || "")) ? PathSplit[Index] : parseInt(PathSplit[Index] || "");
|
|
67
|
+
if (Key !== void 0) {
|
|
68
|
+
const Next = In[Key];
|
|
69
|
+
if (Index !== PathSplit.length - 1) {
|
|
70
|
+
return Recurrence(Next, Index + 1);
|
|
71
|
+
} else {
|
|
72
|
+
return Next;
|
|
73
|
+
}
|
|
74
|
+
} else {
|
|
75
|
+
return void 0;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
return Recurrence(InRecord);
|
|
79
|
+
}
|
|
80
|
+
function MakeRef() {
|
|
81
|
+
return {
|
|
82
|
+
Ref: void 0
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
function MapRecord(InRecord, InFunction) {
|
|
86
|
+
return Object.keys(InRecord).map((InKey, Index) => {
|
|
87
|
+
const Key = InKey;
|
|
88
|
+
return InFunction(Key, InRecord[Key], Index);
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
function FlatMapRecord(InRecord, InFunction) {
|
|
92
|
+
return Object.keys(InRecord).flatMap((InKey, Index) => {
|
|
93
|
+
const Key = InKey;
|
|
94
|
+
const Transform = InFunction(Key, InRecord[Key], Index);
|
|
95
|
+
return Array.isArray(Transform) ? Transform : [Transform];
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* @file Record.ts
|
|
100
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
101
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
102
|
+
* @license MIT
|
|
103
|
+
*/
|
|
104
|
+
/**
|
|
105
|
+
* @file Record.Types.ts
|
|
106
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
107
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
108
|
+
* @license MIT
|
|
109
|
+
*/
|
|
110
|
+
/**
|
|
111
|
+
* @file index.ts
|
|
112
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
113
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
114
|
+
* @license MIT
|
|
115
|
+
*/
|
|
116
|
+
//# sourceMappingURL=record.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../Source/Record/index.ts", "../Source/Record/Record.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 \"./Record.ts\";\nexport * from \"./Record.Types.ts\";\n", "/**\n * @file Record.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nimport type { TFlatMapRecordTransformer, TFromPath, TMapRecordTransformer, TPath, TRef } from \"./Record.Types.ts\";\n// @TODO Write example for `SetPropertyFromPath`.\n/* eslint-disable jsdoc/require-example */\n/**\n * Set a value within a given {@link InRecord | Record} at a given {@link Path} to be a given\n * {@link Value}.\n *\n * @param InRecord - The {@link Record} that holds the value with path {@link Path} to be retrieved\n * by this function.\n * @param Path - The {@link PathType} that describes the property to be retrieved by this.\n * @param Value - The value to be set at the given {@link Path} of the given {@link InRecord | Record}.\n *\n * @throws {Error} An {@link Error} iff the given {@link Path} is an {@link Array}, rather than a\n * `.`-delimited `string`.\n */\nexport function SetPropertyFromPath<RecordType extends Record<string | number, unknown>, PathType extends TPath<RecordType>>(InRecord: RecordType, Path: PathType, Value: TFromPath<RecordType, PathType>): void {\n type FProperty = TFromPath<RecordType, PathType>;\n if (Array.isArray(Path)) {\n throw new Error(\"SetPropertyFromPath does not support Array-based paths yet.\");\n }\n const PathSplit: Array<string> = Path.split(\".\");\n const Last: string | undefined = PathSplit.pop();\n if (Last === undefined) {\n return;\n }\n if (PathSplit.length === 0) {\n if (!Array.isArray(Path)) {\n ((InRecord.Ref as Record<string, unknown>)[(Path as string)]) = Value;\n }\n }\n const Recurrence = (In: unknown): unknown | undefined => {\n const NextPropertyNameBase: string | undefined = PathSplit.shift();\n if (NextPropertyNameBase !== undefined) {\n const NextPropertyName: string | number = isNaN(parseInt(NextPropertyNameBase))\n ? NextPropertyNameBase\n : parseInt(NextPropertyNameBase);\n const Out: unknown = (In as Record<string, unknown>)[NextPropertyName] as unknown;\n return Recurrence(Out);\n }\n else {\n return In;\n }\n };\n const PropertyRef: TRef<FProperty> = Recurrence(InRecord) as TRef<FProperty>;\n const LastTyped: string | number = isNaN(parseInt(Last))\n ? Last\n : parseInt(Last);\n (PropertyRef.Ref as Record<string, unknown>)[LastTyped] = Value;\n}\n;\n/* eslint-enable jsdoc/require-example */\n// @TODO Write example for `GetPropertyFromPath`.\n/* eslint-disable jsdoc/require-example */\n/**\n * Get a value within a given {@link InRecord | Record} at a given {@link Path}.\n *\n * @param InRecord - The {@link Record} that holds the value with path {@link Path} to be retrieved\n * by this function.\n * @param Path - The {@link PathType} that describes the property to be retrieved by this.\n *\n * @throws {Error} An {@link Error} iff the given {@link Path} is an {@link Array}, rather than a\n * `.`-delimited `string`.\n *\n * @returns {TFromPath<RecordType, PathType>} The value in the {@link InRecord} at the given {@link Path}.\n */\nexport function GetPropertyFromPath<RecordType extends Record<string, unknown>, PathType extends TPath<RecordType>>(InRecord: RecordType, Path: PathType): TFromPath<RecordType, PathType> {\n if (Array.isArray(Path)) {\n throw new Error(\"GetPropertyFromPath does not support Array-based paths yet.\");\n }\n const PathSplit: Array<string> = Path.split(\".\");\n const Recurrence = (In: unknown, Index: number = 0): unknown => {\n const Key: string | number | undefined = isNaN(parseInt(PathSplit[Index] || \"\"))\n ? PathSplit[Index]\n : parseInt(PathSplit[Index] || \"\");\n if (Key !== undefined) {\n const Next: unknown = (In as Record<string, unknown>)[Key];\n if (Index !== PathSplit.length - 1) {\n return Recurrence(Next, Index + 1);\n }\n else {\n return Next;\n }\n }\n else {\n return undefined;\n }\n };\n return Recurrence(InRecord) as TFromPath<RecordType, PathType>;\n}\n;\n/* eslint-enable jsdoc/require-example */\n/**\n * Creates a {@link TRef} of a given {@link Type}. Useful for passing\n * primitives to functions by-reference.\n *\n * @template Type - The type of the value wrapped by the returned {@link TRef}.\n *\n * @returns {TRef<Type>} A {@link TRef} of the given {@link Type}.\n */\nexport function MakeRef<Type>(): TRef<Type> {\n return {\n Ref: undefined\n } as TRef<Type>;\n}\n;\n// @TODO Write example for `MapRecord`.\n/* eslint-disable jsdoc/require-example */\n/**\n * Maps a {@link Record} to an {@link Array}.\n *\n * @param InRecord - The {@link Record} over which this function maps.\n * @param InFunction - The {@link TFlatMapRecordTransformer | transformer} that maps\n * the record to an {@link Array}.\n *\n * @returns {Array<ElementType>} An {@link Array} of elements, mapped from the given {@link InRecord}.\n */\nexport function MapRecord<KeyType extends PropertyKey, PropertyType, ElementType>(InRecord: Record<KeyType, PropertyType>, InFunction: TMapRecordTransformer<KeyType, PropertyType, ElementType>): Array<ElementType> {\n return Object.keys(InRecord).map((InKey: string, Index: number): ElementType => {\n const Key: KeyType = InKey as KeyType;\n return InFunction(Key, InRecord[Key], Index);\n });\n}\n;\n/* eslint-enable jsdoc/require-example */\n// @TODO Write example for `FlatMapRecord`.\n/* eslint-disable jsdoc/require-example */\n/**\n * Maps a {@link Record} to an {@link Array}.\n *\n * @param InRecord - The {@link Record} over which this function maps.\n * @param InFunction - The {@link TFlatMapRecordTransformer | transformer} that maps\n * the record to an {@link Array}.\n *\n * @returns {Array<ElementType>} An {@link Array} of elements, mapped from the given {@link InRecord}.\n */\nexport function FlatMapRecord<KeyType extends PropertyKey, PropertyType, ElementType>(InRecord: Record<KeyType, PropertyType>, InFunction: TFlatMapRecordTransformer<KeyType, PropertyType, ElementType>): Array<ElementType> {\n return Object.keys(InRecord).flatMap((InKey: string, Index: number): Array<ElementType> => {\n const Key: KeyType = InKey as KeyType;\n const Transform: ElementType | Array<ElementType> = InFunction(Key, InRecord[Key], Index);\n return Array.isArray(Transform)\n ? Transform\n : [Transform];\n });\n}\n/* eslint-enable jsdoc/require-example */\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACqBO,SAAS,oBAA6G,UAAsB,MAAgB,OAA8C;AAE7M,MAAI,MAAM,QAAQ,IAAI,GAAG;AACrB,UAAM,IAAI,MAAM,6DAA6D;AAAA,EACjF;AACA,QAAM,YAA2B,KAAK,MAAM,GAAG;AAC/C,QAAM,OAA2B,UAAU,IAAI;AAC/C,MAAI,SAAS,QAAW;AACpB;AAAA,EACJ;AACA,MAAI,UAAU,WAAW,GAAG;AACxB,QAAI,CAAC,MAAM,QAAQ,IAAI,GAAG;AACtB,MAAE,SAAS,IAAiC,IAAe,IAAK;AAAA,IACpE;AAAA,EACJ;AACA,QAAM,aAAa,CAAC,OAAqC;AACrD,UAAM,uBAA2C,UAAU,MAAM;AACjE,QAAI,yBAAyB,QAAW;AACpC,YAAM,mBAAoC,MAAM,SAAS,oBAAoB,CAAC,IACxE,uBACA,SAAS,oBAAoB;AACnC,YAAM,MAAgB,GAA+B,gBAAgB;AACrE,aAAO,WAAW,GAAG;AAAA,IACzB,OACK;AACD,aAAO;AAAA,IACX;AAAA,EACJ;AACA,QAAM,cAA+B,WAAW,QAAQ;AACxD,QAAM,YAA6B,MAAM,SAAS,IAAI,CAAC,IACjD,OACA,SAAS,IAAI;AACnB,EAAC,YAAY,IAAgC,SAAS,IAAI;AAC9D;AAiBO,SAAS,oBAAoG,UAAsB,MAAiD;AACvL,MAAI,MAAM,QAAQ,IAAI,GAAG;AACrB,UAAM,IAAI,MAAM,6DAA6D;AAAA,EACjF;AACA,QAAM,YAA2B,KAAK,MAAM,GAAG;AAC/C,QAAM,aAAa,CAAC,IAAa,QAAgB,MAAe;AAC5D,UAAM,MAAmC,MAAM,SAAS,UAAU,KAAK,KAAK,EAAE,CAAC,IACzE,UAAU,KAAK,IACf,SAAS,UAAU,KAAK,KAAK,EAAE;AACrC,QAAI,QAAQ,QAAW;AACnB,YAAM,OAAiB,GAA+B,GAAG;AACzD,UAAI,UAAU,UAAU,SAAS,GAAG;AAChC,eAAO,WAAW,MAAM,QAAQ,CAAC;AAAA,MACrC,OACK;AACD,eAAO;AAAA,MACX;AAAA,IACJ,OACK;AACD,aAAO;AAAA,IACX;AAAA,EACJ;AACA,SAAO,WAAW,QAAQ;AAC9B;AAWO,SAAS,UAA4B;AACxC,SAAO;AAAA,IACH,KAAK;AAAA,EACT;AACJ;AAaO,SAAS,UAAkE,UAAyC,YAA2F;AAClN,SAAO,OAAO,KAAK,QAAQ,EAAE,IAAI,CAAC,OAAe,UAA+B;AAC5E,UAAM,MAAe;AACrB,WAAO,WAAW,KAAK,SAAS,GAAG,GAAG,KAAK;AAAA,EAC/C,CAAC;AACL;AAcO,SAAS,cAAsE,UAAyC,YAA+F;AAC1N,SAAO,OAAO,KAAK,QAAQ,EAAE,QAAQ,CAAC,OAAe,UAAsC;AACvF,UAAM,MAAe;AACrB,UAAM,YAA8C,WAAW,KAAK,SAAS,GAAG,GAAG,KAAK;AACxF,WAAO,MAAM,QAAQ,SAAS,IACxB,YACA,CAAC,SAAS;AAAA,EACpB,CAAC;AACL;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// Source/Record/Record.ts
|
|
2
|
+
function SetPropertyFromPath(InRecord, Path, Value) {
|
|
3
|
+
if (Array.isArray(Path)) {
|
|
4
|
+
throw new Error("SetPropertyFromPath does not support Array-based paths yet.");
|
|
5
|
+
}
|
|
6
|
+
const PathSplit = Path.split(".");
|
|
7
|
+
const Last = PathSplit.pop();
|
|
8
|
+
if (Last === void 0) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
if (PathSplit.length === 0) {
|
|
12
|
+
if (!Array.isArray(Path)) {
|
|
13
|
+
InRecord.Ref[Path] = Value;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
const Recurrence = (In) => {
|
|
17
|
+
const NextPropertyNameBase = PathSplit.shift();
|
|
18
|
+
if (NextPropertyNameBase !== void 0) {
|
|
19
|
+
const NextPropertyName = isNaN(parseInt(NextPropertyNameBase)) ? NextPropertyNameBase : parseInt(NextPropertyNameBase);
|
|
20
|
+
const Out = In[NextPropertyName];
|
|
21
|
+
return Recurrence(Out);
|
|
22
|
+
} else {
|
|
23
|
+
return In;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
const PropertyRef = Recurrence(InRecord);
|
|
27
|
+
const LastTyped = isNaN(parseInt(Last)) ? Last : parseInt(Last);
|
|
28
|
+
PropertyRef.Ref[LastTyped] = Value;
|
|
29
|
+
}
|
|
30
|
+
function GetPropertyFromPath(InRecord, Path) {
|
|
31
|
+
if (Array.isArray(Path)) {
|
|
32
|
+
throw new Error("GetPropertyFromPath does not support Array-based paths yet.");
|
|
33
|
+
}
|
|
34
|
+
const PathSplit = Path.split(".");
|
|
35
|
+
const Recurrence = (In, Index = 0) => {
|
|
36
|
+
const Key = isNaN(parseInt(PathSplit[Index] || "")) ? PathSplit[Index] : parseInt(PathSplit[Index] || "");
|
|
37
|
+
if (Key !== void 0) {
|
|
38
|
+
const Next = In[Key];
|
|
39
|
+
if (Index !== PathSplit.length - 1) {
|
|
40
|
+
return Recurrence(Next, Index + 1);
|
|
41
|
+
} else {
|
|
42
|
+
return Next;
|
|
43
|
+
}
|
|
44
|
+
} else {
|
|
45
|
+
return void 0;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
return Recurrence(InRecord);
|
|
49
|
+
}
|
|
50
|
+
function MakeRef() {
|
|
51
|
+
return {
|
|
52
|
+
Ref: void 0
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function MapRecord(InRecord, InFunction) {
|
|
56
|
+
return Object.keys(InRecord).map((InKey, Index) => {
|
|
57
|
+
const Key = InKey;
|
|
58
|
+
return InFunction(Key, InRecord[Key], Index);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
function FlatMapRecord(InRecord, InFunction) {
|
|
62
|
+
return Object.keys(InRecord).flatMap((InKey, Index) => {
|
|
63
|
+
const Key = InKey;
|
|
64
|
+
const Transform = InFunction(Key, InRecord[Key], Index);
|
|
65
|
+
return Array.isArray(Transform) ? Transform : [Transform];
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
export {
|
|
69
|
+
FlatMapRecord,
|
|
70
|
+
GetPropertyFromPath,
|
|
71
|
+
MakeRef,
|
|
72
|
+
MapRecord,
|
|
73
|
+
SetPropertyFromPath
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* @file Record.ts
|
|
77
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
78
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
79
|
+
* @license MIT
|
|
80
|
+
*/
|
|
81
|
+
/**
|
|
82
|
+
* @file Record.Types.ts
|
|
83
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
84
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
85
|
+
* @license MIT
|
|
86
|
+
*/
|
|
87
|
+
/**
|
|
88
|
+
* @file index.ts
|
|
89
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
90
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
91
|
+
* @license MIT
|
|
92
|
+
*/
|
|
93
|
+
//# sourceMappingURL=record.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../Source/Record/Record.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * @file Record.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nimport type { TFlatMapRecordTransformer, TFromPath, TMapRecordTransformer, TPath, TRef } from \"./Record.Types.ts\";\n// @TODO Write example for `SetPropertyFromPath`.\n/* eslint-disable jsdoc/require-example */\n/**\n * Set a value within a given {@link InRecord | Record} at a given {@link Path} to be a given\n * {@link Value}.\n *\n * @param InRecord - The {@link Record} that holds the value with path {@link Path} to be retrieved\n * by this function.\n * @param Path - The {@link PathType} that describes the property to be retrieved by this.\n * @param Value - The value to be set at the given {@link Path} of the given {@link InRecord | Record}.\n *\n * @throws {Error} An {@link Error} iff the given {@link Path} is an {@link Array}, rather than a\n * `.`-delimited `string`.\n */\nexport function SetPropertyFromPath<RecordType extends Record<string | number, unknown>, PathType extends TPath<RecordType>>(InRecord: RecordType, Path: PathType, Value: TFromPath<RecordType, PathType>): void {\n type FProperty = TFromPath<RecordType, PathType>;\n if (Array.isArray(Path)) {\n throw new Error(\"SetPropertyFromPath does not support Array-based paths yet.\");\n }\n const PathSplit: Array<string> = Path.split(\".\");\n const Last: string | undefined = PathSplit.pop();\n if (Last === undefined) {\n return;\n }\n if (PathSplit.length === 0) {\n if (!Array.isArray(Path)) {\n ((InRecord.Ref as Record<string, unknown>)[(Path as string)]) = Value;\n }\n }\n const Recurrence = (In: unknown): unknown | undefined => {\n const NextPropertyNameBase: string | undefined = PathSplit.shift();\n if (NextPropertyNameBase !== undefined) {\n const NextPropertyName: string | number = isNaN(parseInt(NextPropertyNameBase))\n ? NextPropertyNameBase\n : parseInt(NextPropertyNameBase);\n const Out: unknown = (In as Record<string, unknown>)[NextPropertyName] as unknown;\n return Recurrence(Out);\n }\n else {\n return In;\n }\n };\n const PropertyRef: TRef<FProperty> = Recurrence(InRecord) as TRef<FProperty>;\n const LastTyped: string | number = isNaN(parseInt(Last))\n ? Last\n : parseInt(Last);\n (PropertyRef.Ref as Record<string, unknown>)[LastTyped] = Value;\n}\n;\n/* eslint-enable jsdoc/require-example */\n// @TODO Write example for `GetPropertyFromPath`.\n/* eslint-disable jsdoc/require-example */\n/**\n * Get a value within a given {@link InRecord | Record} at a given {@link Path}.\n *\n * @param InRecord - The {@link Record} that holds the value with path {@link Path} to be retrieved\n * by this function.\n * @param Path - The {@link PathType} that describes the property to be retrieved by this.\n *\n * @throws {Error} An {@link Error} iff the given {@link Path} is an {@link Array}, rather than a\n * `.`-delimited `string`.\n *\n * @returns {TFromPath<RecordType, PathType>} The value in the {@link InRecord} at the given {@link Path}.\n */\nexport function GetPropertyFromPath<RecordType extends Record<string, unknown>, PathType extends TPath<RecordType>>(InRecord: RecordType, Path: PathType): TFromPath<RecordType, PathType> {\n if (Array.isArray(Path)) {\n throw new Error(\"GetPropertyFromPath does not support Array-based paths yet.\");\n }\n const PathSplit: Array<string> = Path.split(\".\");\n const Recurrence = (In: unknown, Index: number = 0): unknown => {\n const Key: string | number | undefined = isNaN(parseInt(PathSplit[Index] || \"\"))\n ? PathSplit[Index]\n : parseInt(PathSplit[Index] || \"\");\n if (Key !== undefined) {\n const Next: unknown = (In as Record<string, unknown>)[Key];\n if (Index !== PathSplit.length - 1) {\n return Recurrence(Next, Index + 1);\n }\n else {\n return Next;\n }\n }\n else {\n return undefined;\n }\n };\n return Recurrence(InRecord) as TFromPath<RecordType, PathType>;\n}\n;\n/* eslint-enable jsdoc/require-example */\n/**\n * Creates a {@link TRef} of a given {@link Type}. Useful for passing\n * primitives to functions by-reference.\n *\n * @template Type - The type of the value wrapped by the returned {@link TRef}.\n *\n * @returns {TRef<Type>} A {@link TRef} of the given {@link Type}.\n */\nexport function MakeRef<Type>(): TRef<Type> {\n return {\n Ref: undefined\n } as TRef<Type>;\n}\n;\n// @TODO Write example for `MapRecord`.\n/* eslint-disable jsdoc/require-example */\n/**\n * Maps a {@link Record} to an {@link Array}.\n *\n * @param InRecord - The {@link Record} over which this function maps.\n * @param InFunction - The {@link TFlatMapRecordTransformer | transformer} that maps\n * the record to an {@link Array}.\n *\n * @returns {Array<ElementType>} An {@link Array} of elements, mapped from the given {@link InRecord}.\n */\nexport function MapRecord<KeyType extends PropertyKey, PropertyType, ElementType>(InRecord: Record<KeyType, PropertyType>, InFunction: TMapRecordTransformer<KeyType, PropertyType, ElementType>): Array<ElementType> {\n return Object.keys(InRecord).map((InKey: string, Index: number): ElementType => {\n const Key: KeyType = InKey as KeyType;\n return InFunction(Key, InRecord[Key], Index);\n });\n}\n;\n/* eslint-enable jsdoc/require-example */\n// @TODO Write example for `FlatMapRecord`.\n/* eslint-disable jsdoc/require-example */\n/**\n * Maps a {@link Record} to an {@link Array}.\n *\n * @param InRecord - The {@link Record} over which this function maps.\n * @param InFunction - The {@link TFlatMapRecordTransformer | transformer} that maps\n * the record to an {@link Array}.\n *\n * @returns {Array<ElementType>} An {@link Array} of elements, mapped from the given {@link InRecord}.\n */\nexport function FlatMapRecord<KeyType extends PropertyKey, PropertyType, ElementType>(InRecord: Record<KeyType, PropertyType>, InFunction: TFlatMapRecordTransformer<KeyType, PropertyType, ElementType>): Array<ElementType> {\n return Object.keys(InRecord).flatMap((InKey: string, Index: number): Array<ElementType> => {\n const Key: KeyType = InKey as KeyType;\n const Transform: ElementType | Array<ElementType> = InFunction(Key, InRecord[Key], Index);\n return Array.isArray(Transform)\n ? Transform\n : [Transform];\n });\n}\n/* eslint-enable jsdoc/require-example */\n"],
|
|
5
|
+
"mappings": ";AAqBO,SAAS,oBAA6G,UAAsB,MAAgB,OAA8C;AAE7M,MAAI,MAAM,QAAQ,IAAI,GAAG;AACrB,UAAM,IAAI,MAAM,6DAA6D;AAAA,EACjF;AACA,QAAM,YAA2B,KAAK,MAAM,GAAG;AAC/C,QAAM,OAA2B,UAAU,IAAI;AAC/C,MAAI,SAAS,QAAW;AACpB;AAAA,EACJ;AACA,MAAI,UAAU,WAAW,GAAG;AACxB,QAAI,CAAC,MAAM,QAAQ,IAAI,GAAG;AACtB,MAAE,SAAS,IAAiC,IAAe,IAAK;AAAA,IACpE;AAAA,EACJ;AACA,QAAM,aAAa,CAAC,OAAqC;AACrD,UAAM,uBAA2C,UAAU,MAAM;AACjE,QAAI,yBAAyB,QAAW;AACpC,YAAM,mBAAoC,MAAM,SAAS,oBAAoB,CAAC,IACxE,uBACA,SAAS,oBAAoB;AACnC,YAAM,MAAgB,GAA+B,gBAAgB;AACrE,aAAO,WAAW,GAAG;AAAA,IACzB,OACK;AACD,aAAO;AAAA,IACX;AAAA,EACJ;AACA,QAAM,cAA+B,WAAW,QAAQ;AACxD,QAAM,YAA6B,MAAM,SAAS,IAAI,CAAC,IACjD,OACA,SAAS,IAAI;AACnB,EAAC,YAAY,IAAgC,SAAS,IAAI;AAC9D;AAiBO,SAAS,oBAAoG,UAAsB,MAAiD;AACvL,MAAI,MAAM,QAAQ,IAAI,GAAG;AACrB,UAAM,IAAI,MAAM,6DAA6D;AAAA,EACjF;AACA,QAAM,YAA2B,KAAK,MAAM,GAAG;AAC/C,QAAM,aAAa,CAAC,IAAa,QAAgB,MAAe;AAC5D,UAAM,MAAmC,MAAM,SAAS,UAAU,KAAK,KAAK,EAAE,CAAC,IACzE,UAAU,KAAK,IACf,SAAS,UAAU,KAAK,KAAK,EAAE;AACrC,QAAI,QAAQ,QAAW;AACnB,YAAM,OAAiB,GAA+B,GAAG;AACzD,UAAI,UAAU,UAAU,SAAS,GAAG;AAChC,eAAO,WAAW,MAAM,QAAQ,CAAC;AAAA,MACrC,OACK;AACD,eAAO;AAAA,MACX;AAAA,IACJ,OACK;AACD,aAAO;AAAA,IACX;AAAA,EACJ;AACA,SAAO,WAAW,QAAQ;AAC9B;AAWO,SAAS,UAA4B;AACxC,SAAO;AAAA,IACH,KAAK;AAAA,EACT;AACJ;AAaO,SAAS,UAAkE,UAAyC,YAA2F;AAClN,SAAO,OAAO,KAAK,QAAQ,EAAE,IAAI,CAAC,OAAe,UAA+B;AAC5E,UAAM,MAAe;AACrB,WAAO,WAAW,KAAK,SAAS,GAAG,GAAG,KAAK;AAAA,EAC/C,CAAC;AACL;AAcO,SAAS,cAAsE,UAAyC,YAA+F;AAC1N,SAAO,OAAO,KAAK,QAAQ,EAAE,QAAQ,CAAC,OAAe,UAAsC;AACvF,UAAM,MAAe;AACrB,UAAM,YAA8C,WAAW,KAAK,SAAS,GAAG,GAAG,KAAK;AACxF,WAAO,MAAM,QAAQ,SAAS,IACxB,YACA,CAAC,SAAS;AAAA,EACpB,CAAC;AACL;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sorrell/utilities",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Various TypeScript utilities.",
|
|
6
6
|
"keywords": [
|
|
@@ -101,6 +101,16 @@
|
|
|
101
101
|
"default": "./Distribution/functional.cjs"
|
|
102
102
|
}
|
|
103
103
|
},
|
|
104
|
+
"./dependency": {
|
|
105
|
+
"import": {
|
|
106
|
+
"types": "./Distribution/Types/Dependency/index.d.mts",
|
|
107
|
+
"default": "./Distribution/dependency.js"
|
|
108
|
+
},
|
|
109
|
+
"require": {
|
|
110
|
+
"types": "./Distribution/Types/Dependency/index.d.cts",
|
|
111
|
+
"default": "./Distribution/dependency.cjs"
|
|
112
|
+
}
|
|
113
|
+
},
|
|
104
114
|
"./misc": {
|
|
105
115
|
"import": {
|
|
106
116
|
"types": "./Distribution/Types/Miscellaneous/index.d.mts",
|