@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,28 @@
|
|
|
1
|
+
// Source/Array/Array.ts
|
|
2
|
+
function FilterDefined(Array) {
|
|
3
|
+
return Array.filter((Element) => {
|
|
4
|
+
return Element !== void 0;
|
|
5
|
+
});
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
FilterDefined
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* @file Array.ts
|
|
12
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
13
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
14
|
+
* @license MIT
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* @file Array.Types.ts
|
|
18
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
19
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
20
|
+
* @license MIT
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* @file index.ts
|
|
24
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
25
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
26
|
+
* @license MIT
|
|
27
|
+
*/
|
|
28
|
+
//# sourceMappingURL=array.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../Source/Array/Array.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * @file Array.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nimport type { FilteredArray, Options, TArrayType } from \"./Array.Types.ts\";\nimport type { NoOptions } from \"../Miscellaneous/Utility.Types.ts\";\n/**\n * Filter out all instances of `undefined` from a given {@link Array:param}.\n * @param Array - The array to filter.\n *\n * @template ElementType - The type of the elements in the array.\n *\n * @returns {TArrayType<Exclude<ElementType, undefined>, Exclude<OptionsType, Options.MaybeDefined>>}\n * A new `Array` of type `Exclude<ElementType, undefined>` and `OptionsType` that is the given\n * {@link OptionsType}, with the {@link Options.MaybeDefined} option removed.\n *\n * @example With the given {@link ElementType} including `undefined`.\n * ```typescript\n * const MaybeOddNumbers: TArray<number | undefined> = [ 1, 3, undefined, 5 ];\n * const OddNumbers: TArray<number> = FilterDefined(MaybeOddNumbers);\n * ```\n * @example With the given {@link OptionsType} including `Options.MaybeDefined`.\n * ```typescript\n * const MaybeOddNumbers: TArray<number, Options.MaybeDefined> = [ 1, 3, undefined, 5 ];\n * const OddNumbers: TArray<number> = FilterDefined(MaybeOddNumbers);\n * ```\n */\nexport function FilterDefined<ElementType, OptionsType extends Options = NoOptions, ArraySize extends number = number>(Array: TArrayType<ElementType, OptionsType | Options.MaybeDefined, ArraySize>): FilteredArray<ElementType>;\nexport function FilterDefined<ElementType, OptionsType extends Options = NoOptions, ArraySize extends number = number>(Array: TArrayType<ElementType | undefined, OptionsType, ArraySize>): FilteredArray<ElementType>;\nexport function FilterDefined<ElementType, OptionsType extends Options = NoOptions, ArraySize extends number = number>(Array: TArrayType<ElementType | undefined, OptionsType | Options.MaybeDefined, ArraySize>): FilteredArray<ElementType>;\nexport function FilterDefined<ElementType, OptionsType extends Options = NoOptions, ArraySize extends number = number>(Array: TArrayType<ElementType | undefined, OptionsType | Options.MaybeDefined, ArraySize>): FilteredArray<ElementType> {\n return Array.filter((Element: ElementType | undefined): boolean => {\n return Element !== undefined;\n }) as FilteredArray<ElementType>;\n}\n"],
|
|
5
|
+
"mappings": ";AAgCO,SAAS,cAAuG,OAAuH;AAC1O,SAAO,MAAM,OAAO,CAAC,YAA8C;AAC/D,WAAO,YAAY;AAAA,EACvB,CAAC;AACL;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,174 @@
|
|
|
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/Async/index.ts
|
|
21
|
+
var Async_exports = {};
|
|
22
|
+
__export(Async_exports, {
|
|
23
|
+
FPromiseInstantiationError: () => FPromiseInstantiationError,
|
|
24
|
+
Map: () => Map,
|
|
25
|
+
TPromise: () => TPromise,
|
|
26
|
+
TPromiseLike: () => TPromiseLike,
|
|
27
|
+
Try: () => Try
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(Async_exports);
|
|
30
|
+
|
|
31
|
+
// Source/Miscellaneous/Utility.Types.ts
|
|
32
|
+
var AbstractMethodCallError = class extends Error {
|
|
33
|
+
constructor(ClassName) {
|
|
34
|
+
super(ClassName);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
// Source/Async/Async.ts
|
|
39
|
+
async function Try(Source) {
|
|
40
|
+
try {
|
|
41
|
+
const Data = typeof Source === "function" ? await Source() : await Source;
|
|
42
|
+
return {
|
|
43
|
+
Data,
|
|
44
|
+
Error: void 0
|
|
45
|
+
};
|
|
46
|
+
} catch (ErrorValue) {
|
|
47
|
+
return {
|
|
48
|
+
Data: void 0,
|
|
49
|
+
Error: ErrorValue
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
async function Map(Elements, Mapper) {
|
|
54
|
+
const MapperWrapped = async (Element) => {
|
|
55
|
+
return Mapper(Element);
|
|
56
|
+
};
|
|
57
|
+
const Out = Elements.map(MapperWrapped);
|
|
58
|
+
return await Promise.all(Out);
|
|
59
|
+
}
|
|
60
|
+
var TPromiseLike = class {
|
|
61
|
+
then(_OnFulfilled, _OnRejected) {
|
|
62
|
+
throw new AbstractMethodCallError("TPromiseLike");
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
var FPromiseInstantiationError = class extends TypeError {
|
|
66
|
+
constructor() {
|
|
67
|
+
super();
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
var TPromise = class _TPromise extends TPromiseLike {
|
|
71
|
+
constructor(Argument) {
|
|
72
|
+
super();
|
|
73
|
+
if (typeof Argument === "function") {
|
|
74
|
+
this.Underlying = new Promise(Argument);
|
|
75
|
+
} else {
|
|
76
|
+
if (Argument instanceof _TPromise) {
|
|
77
|
+
this.Underlying = Argument.Raw();
|
|
78
|
+
} else if (Argument instanceof Promise) {
|
|
79
|
+
this.Underlying = Argument;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
throw new FPromiseInstantiationError();
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* This class's extension of {@link Promise!then}.
|
|
86
|
+
*
|
|
87
|
+
* @template ResultType - The type to which the value underlying the {@link TPromise} returned by this
|
|
88
|
+
* will resolve, if the {@link TPromise} resolves.
|
|
89
|
+
*
|
|
90
|
+
* @template RejectType - The type to which the value underlying the {@link TPromise} returned by this
|
|
91
|
+
* will reject, if the {@link TPromise} rejects.
|
|
92
|
+
*
|
|
93
|
+
* @param OnFulfilled - The callback that is called when the underlying {@link Promise} resolves,
|
|
94
|
+
* if it resolves.
|
|
95
|
+
*
|
|
96
|
+
* @param OnRejected - The callback that is called when the underlying {@link Promise} rejects,
|
|
97
|
+
* if it rejects.
|
|
98
|
+
*
|
|
99
|
+
* @returns {TPromise<ResultType | RejectType>} A new {@link TPromise} of the result of the
|
|
100
|
+
* given callbacks.
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```typescript
|
|
104
|
+
* const Example: TPromise<string> = new TPromise<string>((Resolve, Reject) =>
|
|
105
|
+
* {
|
|
106
|
+
* if (Math.random() < 0.5)
|
|
107
|
+
* {
|
|
108
|
+
* Resolve("Success");
|
|
109
|
+
* }
|
|
110
|
+
* else
|
|
111
|
+
* {
|
|
112
|
+
* Reject("Error");
|
|
113
|
+
* }
|
|
114
|
+
* });
|
|
115
|
+
*
|
|
116
|
+
* Example.then(
|
|
117
|
+
* (Value: string): void =>
|
|
118
|
+
* {
|
|
119
|
+
* // `Value` <- `"Success"`
|
|
120
|
+
* },
|
|
121
|
+
* (Reason: unknown): void =>
|
|
122
|
+
* {
|
|
123
|
+
* // `Reason` <- `"Error"`
|
|
124
|
+
* }
|
|
125
|
+
* );
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
128
|
+
Then(OnFulfilled, OnRejected) {
|
|
129
|
+
return new _TPromise(this.Underlying.then(OnFulfilled, OnRejected));
|
|
130
|
+
}
|
|
131
|
+
then(OnFulfilled, OnRejected) {
|
|
132
|
+
return new _TPromise(this.Underlying.then(OnFulfilled, OnRejected));
|
|
133
|
+
}
|
|
134
|
+
Catch(OnRejected) {
|
|
135
|
+
return new _TPromise(this.Underlying.catch(OnRejected));
|
|
136
|
+
}
|
|
137
|
+
Finally(OnFinally) {
|
|
138
|
+
return new _TPromise(this.Underlying.finally(OnFinally));
|
|
139
|
+
}
|
|
140
|
+
static Resolve(Value) {
|
|
141
|
+
return new _TPromise(Promise.resolve(Value));
|
|
142
|
+
}
|
|
143
|
+
static Reject(Reason) {
|
|
144
|
+
return new _TPromise(Promise.reject(Reason));
|
|
145
|
+
}
|
|
146
|
+
Raw() {
|
|
147
|
+
return this.Underlying;
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* @file Utility.Types.ts
|
|
152
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
153
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
154
|
+
* @license MIT
|
|
155
|
+
*/
|
|
156
|
+
/**
|
|
157
|
+
* @file Async.ts
|
|
158
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
159
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
160
|
+
* @license MIT
|
|
161
|
+
*/
|
|
162
|
+
/**
|
|
163
|
+
* @file Promise.Types.ts
|
|
164
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
165
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
166
|
+
* @license MIT
|
|
167
|
+
*/
|
|
168
|
+
/**
|
|
169
|
+
* @file index.ts
|
|
170
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
171
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
172
|
+
* @license MIT
|
|
173
|
+
*/
|
|
174
|
+
//# sourceMappingURL=async.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../Source/Async/index.ts", "../Source/Miscellaneous/Utility.Types.ts", "../Source/Async/Async.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 \"./Async.ts\";\nexport * from \"./Async.Types.ts\";\n", "/**\n * @file Utility.Types.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nimport type { 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", "/**\n * @file Async.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nimport { AbstractMethodCallError, type TNullable } from \"../Miscellaneous/Utility.Types.ts\";\nimport type { TOnFulfilled, TOnRejected, TPromiseCtorArgument, TTryResult, TTrySource } from \"./Async.Types.ts\";\nimport type { TFunction } from \"../Functional/Functional.Types.ts\";\n/**\n * Implements \"Errors-as-values\" for `async` functions and `Promise<DataType>`s.\n *\n * If the `async` function or `Promise<DataType>` returns/resolves, then the `Error`\n * property of the returned object will be `undefined`, and the result of the\n * `async` function or `Promise<DataType>` will reside in the `Data` property of the\n * returned object.\n *\n * Similarly, if the `async` function or `Promise<DataType>` throws, then the `Data`\n * property of the returned object is `undefined`, and the `Error` property is what\n * was thrown to the `catch` block.\n *\n * @template DataType - The type of the data that the `async` function or `Promise<DataType>`.\n * @param Source - The `async` function or `Promise` to evaluate.\n *\n * @returns {TTryResult<DataType>} A {@link TTryResult} containing either the result\n * ({@link TTryResult.Data}) or error {@link TTryResult.Error}.\n *\n * @example\n * // With an `async` function,\n * async function GetName(): Promise<string> { ... }\n * // Or, with a `Promise`,\n * const GetName: Promise<string> = new Promise<string>(...);\n *\n * // For both of the above cases, `Try` behaves the same:\n * const { Data: Name, Error: NameError } = await Try(GetName);\n * // If `GetName` returned,\n * // `typeof Name` <- `\"string\"`\n * // `typeof NameError` <- `\"undefined\"`\n * // If `GetName` threw,\n * // `typeof Name` <- `\"undefined\"`\n * // `NameError !== undefined` <- `true` (Unless `GetName` threw `undefined`).\n */\nexport async function Try<DataType>(Source: TTrySource<DataType>): Promise<TTryResult<DataType>> {\n try {\n const Data: DataType = typeof Source === \"function\"\n ? await Source()\n : await Source;\n return {\n Data,\n Error: undefined\n };\n }\n catch (ErrorValue: unknown) {\n return {\n Data: undefined,\n Error: ErrorValue\n };\n }\n}\n/**\n * A cleaner way of using `Array.prototype.map` with an `async` function.\n *\n * @template ArgumentElementType - The type of the given {@link Elements}.\n * @template ReturnElementType - The type of the `Array` returned by this.\n *\n * @param Elements - The `Array` that will be transformed.\n * @param Mapper - The function that maps each {@link ArgumentElementType}\n * to a {@link ReturnElementType}.\n *\n * @returns {Array<ReturnElementType>} An `Array` of {@link ReturnElementType}.\n *\n * @example\n * In an `async` function,\n * ```typescript\n * const ArgumentElements: Array<ArgumentElementType> = [ ... ];\n * const ToReturnElement = async (Element: ArgumentElementType): Promise<ReturnElementType> => ...;\n * const ReturnElements: Array<ReturnElementType> = await Map(ArgumentElements, ToReturnElement);\n * ```\n */\nexport async function Map<ArgumentElementType, ReturnElementType>(Elements: Array<ArgumentElementType>, Mapper: ((Element: ArgumentElementType) => Promise<ReturnElementType>)): Promise<Array<ReturnElementType>> {\n const MapperWrapped = async (Element: ArgumentElementType): Promise<ReturnElementType> => {\n return Mapper(Element);\n };\n const Out: Array<Promise<ReturnElementType>> = Elements.map(MapperWrapped);\n return await Promise.all(Out);\n}\n/**\n * An abstract implementation of {@link PromiseLike}. This exists only to maintain the\n * project's naming convention.\n */\nexport abstract class TPromiseLike<ResolveType> implements PromiseLike<ResolveType> {\n public then<ResultType = ResolveType, RejectType = never>(_OnFulfilled?: TOnFulfilled<ResolveType, ResultType>, _OnRejected?: TOnRejected<RejectType>): TPromiseLike<ResultType | RejectType> {\n throw new AbstractMethodCallError(\"TPromiseLike\");\n }\n}\n/**\n * The {@link TypeError} that is thrown by the constructor of {@link TPromise}\n * iff it receives an argument that is not a {@link TPromiseCtorArgument}.\n * It does not provide any additional information (in particular, it does not\n * add any properties, and it does not set any properties inherited from\n * {@link TypeError}).\n *\n * @note While the argument type of {@link TPromise}'s constructor is checked at runtime,\n * the type checker should prevent the error described by this from happening.\n */\nexport class FPromiseInstantiationError extends TypeError {\n public constructor() {\n super();\n }\n}\n/**\n * A `then`-able wrapper of {@link Promise}.\n *\n * @template ResolveType - The type to which this resolves, if it does resolve.\n */\nexport class TPromise<ResolveType> extends TPromiseLike<ResolveType> implements PromiseLike<ResolveType> {\n public constructor(Argument: TPromiseCtorArgument<ResolveType>) {\n super();\n if (typeof Argument === \"function\") {\n this.Underlying = new Promise<ResolveType>(Argument);\n }\n else {\n if (Argument instanceof TPromise) {\n this.Underlying = Argument.Raw();\n }\n else if (Argument instanceof Promise) {\n this.Underlying = Argument;\n }\n }\n throw new FPromiseInstantiationError();\n }\n private readonly Underlying: Promise<ResolveType>;\n /**\n * This class's extension of {@link Promise!then}.\n *\n * @template ResultType - The type to which the value underlying the {@link TPromise} returned by this\n * will resolve, if the {@link TPromise} resolves.\n *\n * @template RejectType - The type to which the value underlying the {@link TPromise} returned by this\n * will reject, if the {@link TPromise} rejects.\n *\n * @param OnFulfilled - The callback that is called when the underlying {@link Promise} resolves,\n * if it resolves.\n *\n * @param OnRejected - The callback that is called when the underlying {@link Promise} rejects,\n * if it rejects.\n *\n * @returns {TPromise<ResultType | RejectType>} A new {@link TPromise} of the result of the\n * given callbacks.\n *\n * @example\n * ```typescript\n * const Example: TPromise<string> = new TPromise<string>((Resolve, Reject) =>\n * {\n * if (Math.random() < 0.5)\n * {\n * Resolve(\"Success\");\n * }\n * else\n * {\n * Reject(\"Error\");\n * }\n * });\n *\n * Example.then(\n * (Value: string): void =>\n * {\n * // `Value` <- `\"Success\"`\n * },\n * (Reason: unknown): void =>\n * {\n * // `Reason` <- `\"Error\"`\n * }\n * );\n * ```\n */\n public Then<ResultType = ResolveType, RejectType = never>(OnFulfilled: TOnFulfilled<ResolveType, ResultType>, OnRejected?: TOnRejected<RejectType>): TPromise<ResultType | RejectType> {\n return new TPromise<ResultType | RejectType>(this.Underlying.then(OnFulfilled, OnRejected));\n }\n public override then<ResultType = ResolveType, RejectType = never>(OnFulfilled?: TOnFulfilled<ResolveType, ResultType>, OnRejected?: TOnRejected<RejectType>): TPromise<ResultType | RejectType> {\n return new TPromise<ResultType | RejectType>(this.Underlying.then(OnFulfilled, OnRejected));\n }\n public Catch<ResultType = never>(OnRejected?: TNullable<TOnRejected<ResolveType>>): TPromiseLike<ResolveType | ResultType> {\n return new TPromise<ResolveType | ResultType>(this.Underlying.catch(OnRejected));\n }\n public Finally(OnFinally?: TNullable<TFunction>): TPromise<ResolveType> {\n return new TPromise(this.Underlying.finally(OnFinally));\n }\n public static Resolve<ResolveType>(Value: ResolveType | PromiseLike<ResolveType>): TPromise<Awaited<ResolveType>> {\n return new TPromise(Promise.resolve(Value));\n }\n public static Reject<ResolveType = unknown>(Reason?: unknown): TPromise<ResolveType> {\n return new TPromise(Promise.reject<ResolveType>(Reason));\n }\n public Raw(): Promise<ResolveType> {\n return this.Underlying;\n }\n}\n;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACqEO,IAAM,0BAAN,cAAsC,MAAM;AAAA,EACxC,YAAY,WAAoB;AACnC,UAAM,SAAS;AAAA,EACnB;AACJ;;;AC/BA,eAAsB,IAAc,QAA6D;AAC7F,MAAI;AACA,UAAM,OAAiB,OAAO,WAAW,aACnC,MAAM,OAAO,IACb,MAAM;AACZ,WAAO;AAAA,MACH;AAAA,MACA,OAAO;AAAA,IACX;AAAA,EACJ,SACO,YAAqB;AACxB,WAAO;AAAA,MACH,MAAM;AAAA,MACN,OAAO;AAAA,IACX;AAAA,EACJ;AACJ;AAqBA,eAAsB,IAA4C,UAAsC,QAA2G;AAC/M,QAAM,gBAAgB,OAAO,YAA6D;AACtF,WAAO,OAAO,OAAO;AAAA,EACzB;AACA,QAAM,MAAyC,SAAS,IAAI,aAAa;AACzE,SAAO,MAAM,QAAQ,IAAI,GAAG;AAChC;AAKO,IAAe,eAAf,MAA6E;AAAA,EACzE,KAAmD,cAAsD,aAA8E;AAC1L,UAAM,IAAI,wBAAwB,cAAc;AAAA,EACpD;AACJ;AAWO,IAAM,6BAAN,cAAyC,UAAU;AAAA,EAC/C,cAAc;AACjB,UAAM;AAAA,EACV;AACJ;AAMO,IAAM,WAAN,MAAM,kBAA8B,aAA8D;AAAA,EAC9F,YAAY,UAA6C;AAC5D,UAAM;AACN,QAAI,OAAO,aAAa,YAAY;AAChC,WAAK,aAAa,IAAI,QAAqB,QAAQ;AAAA,IACvD,OACK;AACD,UAAI,oBAAoB,WAAU;AAC9B,aAAK,aAAa,SAAS,IAAI;AAAA,MACnC,WACS,oBAAoB,SAAS;AAClC,aAAK,aAAa;AAAA,MACtB;AAAA,IACJ;AACA,UAAM,IAAI,2BAA2B;AAAA,EACzC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA8CO,KAAmD,aAAoD,YAAyE;AACnL,WAAO,IAAI,UAAkC,KAAK,WAAW,KAAK,aAAa,UAAU,CAAC;AAAA,EAC9F;AAAA,EACgB,KAAmD,aAAqD,YAAyE;AAC7L,WAAO,IAAI,UAAkC,KAAK,WAAW,KAAK,aAAa,UAAU,CAAC;AAAA,EAC9F;AAAA,EACO,MAA0B,YAA0F;AACvH,WAAO,IAAI,UAAmC,KAAK,WAAW,MAAM,UAAU,CAAC;AAAA,EACnF;AAAA,EACO,QAAQ,WAAyD;AACpE,WAAO,IAAI,UAAS,KAAK,WAAW,QAAQ,SAAS,CAAC;AAAA,EAC1D;AAAA,EACA,OAAc,QAAqB,OAA+E;AAC9G,WAAO,IAAI,UAAS,QAAQ,QAAQ,KAAK,CAAC;AAAA,EAC9C;AAAA,EACA,OAAc,OAA8B,QAAyC;AACjF,WAAO,IAAI,UAAS,QAAQ,OAAoB,MAAM,CAAC;AAAA,EAC3D;AAAA,EACO,MAA4B;AAC/B,WAAO,KAAK;AAAA,EAChB;AACJ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
// Source/Miscellaneous/Utility.Types.ts
|
|
2
|
+
var AbstractMethodCallError = class extends Error {
|
|
3
|
+
constructor(ClassName) {
|
|
4
|
+
super(ClassName);
|
|
5
|
+
}
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
// Source/Async/Async.ts
|
|
9
|
+
async function Try(Source) {
|
|
10
|
+
try {
|
|
11
|
+
const Data = typeof Source === "function" ? await Source() : await Source;
|
|
12
|
+
return {
|
|
13
|
+
Data,
|
|
14
|
+
Error: void 0
|
|
15
|
+
};
|
|
16
|
+
} catch (ErrorValue) {
|
|
17
|
+
return {
|
|
18
|
+
Data: void 0,
|
|
19
|
+
Error: ErrorValue
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
async function Map(Elements, Mapper) {
|
|
24
|
+
const MapperWrapped = async (Element) => {
|
|
25
|
+
return Mapper(Element);
|
|
26
|
+
};
|
|
27
|
+
const Out = Elements.map(MapperWrapped);
|
|
28
|
+
return await Promise.all(Out);
|
|
29
|
+
}
|
|
30
|
+
var TPromiseLike = class {
|
|
31
|
+
then(_OnFulfilled, _OnRejected) {
|
|
32
|
+
throw new AbstractMethodCallError("TPromiseLike");
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
var FPromiseInstantiationError = class extends TypeError {
|
|
36
|
+
constructor() {
|
|
37
|
+
super();
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
var TPromise = class _TPromise extends TPromiseLike {
|
|
41
|
+
constructor(Argument) {
|
|
42
|
+
super();
|
|
43
|
+
if (typeof Argument === "function") {
|
|
44
|
+
this.Underlying = new Promise(Argument);
|
|
45
|
+
} else {
|
|
46
|
+
if (Argument instanceof _TPromise) {
|
|
47
|
+
this.Underlying = Argument.Raw();
|
|
48
|
+
} else if (Argument instanceof Promise) {
|
|
49
|
+
this.Underlying = Argument;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
throw new FPromiseInstantiationError();
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* This class's extension of {@link Promise!then}.
|
|
56
|
+
*
|
|
57
|
+
* @template ResultType - The type to which the value underlying the {@link TPromise} returned by this
|
|
58
|
+
* will resolve, if the {@link TPromise} resolves.
|
|
59
|
+
*
|
|
60
|
+
* @template RejectType - The type to which the value underlying the {@link TPromise} returned by this
|
|
61
|
+
* will reject, if the {@link TPromise} rejects.
|
|
62
|
+
*
|
|
63
|
+
* @param OnFulfilled - The callback that is called when the underlying {@link Promise} resolves,
|
|
64
|
+
* if it resolves.
|
|
65
|
+
*
|
|
66
|
+
* @param OnRejected - The callback that is called when the underlying {@link Promise} rejects,
|
|
67
|
+
* if it rejects.
|
|
68
|
+
*
|
|
69
|
+
* @returns {TPromise<ResultType | RejectType>} A new {@link TPromise} of the result of the
|
|
70
|
+
* given callbacks.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```typescript
|
|
74
|
+
* const Example: TPromise<string> = new TPromise<string>((Resolve, Reject) =>
|
|
75
|
+
* {
|
|
76
|
+
* if (Math.random() < 0.5)
|
|
77
|
+
* {
|
|
78
|
+
* Resolve("Success");
|
|
79
|
+
* }
|
|
80
|
+
* else
|
|
81
|
+
* {
|
|
82
|
+
* Reject("Error");
|
|
83
|
+
* }
|
|
84
|
+
* });
|
|
85
|
+
*
|
|
86
|
+
* Example.then(
|
|
87
|
+
* (Value: string): void =>
|
|
88
|
+
* {
|
|
89
|
+
* // `Value` <- `"Success"`
|
|
90
|
+
* },
|
|
91
|
+
* (Reason: unknown): void =>
|
|
92
|
+
* {
|
|
93
|
+
* // `Reason` <- `"Error"`
|
|
94
|
+
* }
|
|
95
|
+
* );
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
Then(OnFulfilled, OnRejected) {
|
|
99
|
+
return new _TPromise(this.Underlying.then(OnFulfilled, OnRejected));
|
|
100
|
+
}
|
|
101
|
+
then(OnFulfilled, OnRejected) {
|
|
102
|
+
return new _TPromise(this.Underlying.then(OnFulfilled, OnRejected));
|
|
103
|
+
}
|
|
104
|
+
Catch(OnRejected) {
|
|
105
|
+
return new _TPromise(this.Underlying.catch(OnRejected));
|
|
106
|
+
}
|
|
107
|
+
Finally(OnFinally) {
|
|
108
|
+
return new _TPromise(this.Underlying.finally(OnFinally));
|
|
109
|
+
}
|
|
110
|
+
static Resolve(Value) {
|
|
111
|
+
return new _TPromise(Promise.resolve(Value));
|
|
112
|
+
}
|
|
113
|
+
static Reject(Reason) {
|
|
114
|
+
return new _TPromise(Promise.reject(Reason));
|
|
115
|
+
}
|
|
116
|
+
Raw() {
|
|
117
|
+
return this.Underlying;
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
export {
|
|
121
|
+
FPromiseInstantiationError,
|
|
122
|
+
Map,
|
|
123
|
+
TPromise,
|
|
124
|
+
TPromiseLike,
|
|
125
|
+
Try
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
* @file Utility.Types.ts
|
|
129
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
130
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
131
|
+
* @license MIT
|
|
132
|
+
*/
|
|
133
|
+
/**
|
|
134
|
+
* @file Async.ts
|
|
135
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
136
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
137
|
+
* @license MIT
|
|
138
|
+
*/
|
|
139
|
+
/**
|
|
140
|
+
* @file Promise.Types.ts
|
|
141
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
142
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
143
|
+
* @license MIT
|
|
144
|
+
*/
|
|
145
|
+
/**
|
|
146
|
+
* @file index.ts
|
|
147
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
148
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
149
|
+
* @license MIT
|
|
150
|
+
*/
|
|
151
|
+
//# sourceMappingURL=async.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../Source/Miscellaneous/Utility.Types.ts", "../Source/Async/Async.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * @file Utility.Types.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nimport type { NoOptions } from \"./Utility.Internal.ts\";\nimport type TypeScript from \"typescript\";\n/**\n * @deprecated Use {@link TMutable} instead.\n *\n * Defines a type that corresponds to {@link RecordLike}, such that every\n * `readonly` modifier is removed, recursively.\n *\n * @template RecordLike - The type to make writeable.\n */\nexport type TDeepWriteable<RecordLike> = {\n -readonly [Key in keyof RecordLike]: TDeepWriteable<RecordLike[Key]>;\n};\n/**\n * Defines a type that corresponds to {@link RecordLike}, such that every\n * `readonly` modifier is removed, recursively.\n *\n * @template RecordLike - The type to make writeable.\n * @template ShallowOption - Whether the `readonly` modifier should be stripped recursively.\n * If `true` (the default), then only the properties of the given type will have the `readonly`\n * modifier stripped (that is, if any of these properties is a {@link Record} type with `readonly`\n * modifiers, then those will *not* be removed if {@link ShallowOption} is `true`).\n */\nexport type TMutable<RecordLike, ShallowOption extends boolean = true> = ShallowOption extends false ? {\n -readonly [Key in keyof RecordLike]: RecordLike[Key];\n} : ShallowOption extends true ? {\n -readonly [Key in keyof RecordLike]: TMutable<RecordLike[Key]>;\n} : never;\n/**\n * Given a {@link RecordLike | record-like type}, this type is the union\n * of the values of all properties in the {@link RecordLike | record-like type}.\n *\n * @template RecordLike - The record-like type from which this type extracts value types.\n */\nexport type TValues<RecordLike> = RecordLike[keyof RecordLike];\n/**\n * The element type of the return value of `Object.entries()`.\n *\n * @template RecordLike - The record-like type of the argument of `Object.entries()`.\n * @template KeyType - The subset of keys used by this type.\n */\nexport type TEntry<RecordLike, KeyType extends keyof RecordLike = keyof RecordLike> = [\n KeyType,\n RecordLike[KeyType]\n];\n/** The type used in `OptionsType`s when no options are specified. */\nexport type NoOptions = typeof NoOptions;\n/**\n * Define options for a given type as a union of `unique symbol` types.\n * All options must be *optional* by the type that uses these options.\n * The type that uses these options should have a type parameter `OptionsType`\n * defined with `OptionsType extends TOptions = NoOptions`. You will have to import\n * {@link NoOptions}, but this should be done anyway, since making all options types\n * optional should be optional. For this reason {@link NoOptions} is exported from the\n * same module as this type.\n *\n * @template OptionsType - The `unique symbol` types that act as options.\n *\n * @example * See the {@link Array.Options:type} type as an example.\n */\nexport type TOptions<OptionsType extends symbol = NoOptions> = OptionsType | NoOptions;\nexport type TNullable<Type> = Type | null | undefined;\n/** An error that is thrown in default implementations of `abstract` `class`es. */\nexport class AbstractMethodCallError extends Error {\n public constructor(ClassName?: string) {\n super(ClassName);\n }\n}\n/** The type corresponding to the schema of `tsconfig.json`. */\nexport interface FTsConfig {\n extends?: string | Array<string>;\n files?: Array<string>;\n include?: Array<string>;\n exclude?: Array<string>;\n references?: Array<TypeScript.ProjectReference>;\n compilerOptions?: FCompilerOptions;\n watchOptions?: TypeScript.WatchOptions;\n typeAcquisition?: TypeScript.TypeAcquisition;\n compileOnSave?: boolean;\n}\ntype FOverriddenCompilerOptions = \"jsx\" | \"lib\" | \"module\" | \"moduleResolution\" | \"target\";\ntype FCompilerOptions = Omit<TypeScript.server.protocol.CompilerOptions, FOverriddenCompilerOptions> & Partial<{\n jsx: JsxEmit;\n lib: Array<string>;\n module: FModuleKind;\n moduleResolution: FModuleResolutionKind;\n target: FTarget;\n}>;\ntype JsxEmit = \"none\" | \"preserve\" | \"react-native\" | \"react\" | \"react-jsx\" | \"react-jsxdev\";\ntype FModuleKind = \"none\" | \"commonjs\" | \"amd\" | \"umd\" | \"system\" | \"es6\" | \"es2015\" | \"es2020\" | \"es2022\" | \"esnext\" | \"node16\" | \"node18\" | \"node20\" | \"nodenext\" | \"preserve\";\ntype FModuleResolutionKind = \"classic\" | \"node\" | \"node\" | \"node10\" | \"node16\" | \"nodenext\" | \"bundler\";\ntype FTarget = \"es3\" | \"es5\" | \"es6\" | \"es2015\" | \"es2016\" | \"es2017\" | \"es2018\" | \"es2019\" | \"es2020\" | \"es2021\" | \"es2022\" | \"es2023\" | \"es2024\" | \"es2025\" | \"esnext\" | \"json\" | \"esnext\" | \"es2025\";\n/**\n * Maps a given {@link RecordLike} type to an identical {@link Record} type, but\n * the properties are wrapped with {@link NonNullable}.\n *\n * @template RecordLike - The `Record`-like type from which this type is defined.\n */\nexport type TRecordNonNullable<RecordLike> = {\n [Key in keyof RecordLike]: NonNullable<RecordLike[Key]>;\n};\n", "/**\n * @file Async.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nimport { AbstractMethodCallError, type TNullable } from \"../Miscellaneous/Utility.Types.ts\";\nimport type { TOnFulfilled, TOnRejected, TPromiseCtorArgument, TTryResult, TTrySource } from \"./Async.Types.ts\";\nimport type { TFunction } from \"../Functional/Functional.Types.ts\";\n/**\n * Implements \"Errors-as-values\" for `async` functions and `Promise<DataType>`s.\n *\n * If the `async` function or `Promise<DataType>` returns/resolves, then the `Error`\n * property of the returned object will be `undefined`, and the result of the\n * `async` function or `Promise<DataType>` will reside in the `Data` property of the\n * returned object.\n *\n * Similarly, if the `async` function or `Promise<DataType>` throws, then the `Data`\n * property of the returned object is `undefined`, and the `Error` property is what\n * was thrown to the `catch` block.\n *\n * @template DataType - The type of the data that the `async` function or `Promise<DataType>`.\n * @param Source - The `async` function or `Promise` to evaluate.\n *\n * @returns {TTryResult<DataType>} A {@link TTryResult} containing either the result\n * ({@link TTryResult.Data}) or error {@link TTryResult.Error}.\n *\n * @example\n * // With an `async` function,\n * async function GetName(): Promise<string> { ... }\n * // Or, with a `Promise`,\n * const GetName: Promise<string> = new Promise<string>(...);\n *\n * // For both of the above cases, `Try` behaves the same:\n * const { Data: Name, Error: NameError } = await Try(GetName);\n * // If `GetName` returned,\n * // `typeof Name` <- `\"string\"`\n * // `typeof NameError` <- `\"undefined\"`\n * // If `GetName` threw,\n * // `typeof Name` <- `\"undefined\"`\n * // `NameError !== undefined` <- `true` (Unless `GetName` threw `undefined`).\n */\nexport async function Try<DataType>(Source: TTrySource<DataType>): Promise<TTryResult<DataType>> {\n try {\n const Data: DataType = typeof Source === \"function\"\n ? await Source()\n : await Source;\n return {\n Data,\n Error: undefined\n };\n }\n catch (ErrorValue: unknown) {\n return {\n Data: undefined,\n Error: ErrorValue\n };\n }\n}\n/**\n * A cleaner way of using `Array.prototype.map` with an `async` function.\n *\n * @template ArgumentElementType - The type of the given {@link Elements}.\n * @template ReturnElementType - The type of the `Array` returned by this.\n *\n * @param Elements - The `Array` that will be transformed.\n * @param Mapper - The function that maps each {@link ArgumentElementType}\n * to a {@link ReturnElementType}.\n *\n * @returns {Array<ReturnElementType>} An `Array` of {@link ReturnElementType}.\n *\n * @example\n * In an `async` function,\n * ```typescript\n * const ArgumentElements: Array<ArgumentElementType> = [ ... ];\n * const ToReturnElement = async (Element: ArgumentElementType): Promise<ReturnElementType> => ...;\n * const ReturnElements: Array<ReturnElementType> = await Map(ArgumentElements, ToReturnElement);\n * ```\n */\nexport async function Map<ArgumentElementType, ReturnElementType>(Elements: Array<ArgumentElementType>, Mapper: ((Element: ArgumentElementType) => Promise<ReturnElementType>)): Promise<Array<ReturnElementType>> {\n const MapperWrapped = async (Element: ArgumentElementType): Promise<ReturnElementType> => {\n return Mapper(Element);\n };\n const Out: Array<Promise<ReturnElementType>> = Elements.map(MapperWrapped);\n return await Promise.all(Out);\n}\n/**\n * An abstract implementation of {@link PromiseLike}. This exists only to maintain the\n * project's naming convention.\n */\nexport abstract class TPromiseLike<ResolveType> implements PromiseLike<ResolveType> {\n public then<ResultType = ResolveType, RejectType = never>(_OnFulfilled?: TOnFulfilled<ResolveType, ResultType>, _OnRejected?: TOnRejected<RejectType>): TPromiseLike<ResultType | RejectType> {\n throw new AbstractMethodCallError(\"TPromiseLike\");\n }\n}\n/**\n * The {@link TypeError} that is thrown by the constructor of {@link TPromise}\n * iff it receives an argument that is not a {@link TPromiseCtorArgument}.\n * It does not provide any additional information (in particular, it does not\n * add any properties, and it does not set any properties inherited from\n * {@link TypeError}).\n *\n * @note While the argument type of {@link TPromise}'s constructor is checked at runtime,\n * the type checker should prevent the error described by this from happening.\n */\nexport class FPromiseInstantiationError extends TypeError {\n public constructor() {\n super();\n }\n}\n/**\n * A `then`-able wrapper of {@link Promise}.\n *\n * @template ResolveType - The type to which this resolves, if it does resolve.\n */\nexport class TPromise<ResolveType> extends TPromiseLike<ResolveType> implements PromiseLike<ResolveType> {\n public constructor(Argument: TPromiseCtorArgument<ResolveType>) {\n super();\n if (typeof Argument === \"function\") {\n this.Underlying = new Promise<ResolveType>(Argument);\n }\n else {\n if (Argument instanceof TPromise) {\n this.Underlying = Argument.Raw();\n }\n else if (Argument instanceof Promise) {\n this.Underlying = Argument;\n }\n }\n throw new FPromiseInstantiationError();\n }\n private readonly Underlying: Promise<ResolveType>;\n /**\n * This class's extension of {@link Promise!then}.\n *\n * @template ResultType - The type to which the value underlying the {@link TPromise} returned by this\n * will resolve, if the {@link TPromise} resolves.\n *\n * @template RejectType - The type to which the value underlying the {@link TPromise} returned by this\n * will reject, if the {@link TPromise} rejects.\n *\n * @param OnFulfilled - The callback that is called when the underlying {@link Promise} resolves,\n * if it resolves.\n *\n * @param OnRejected - The callback that is called when the underlying {@link Promise} rejects,\n * if it rejects.\n *\n * @returns {TPromise<ResultType | RejectType>} A new {@link TPromise} of the result of the\n * given callbacks.\n *\n * @example\n * ```typescript\n * const Example: TPromise<string> = new TPromise<string>((Resolve, Reject) =>\n * {\n * if (Math.random() < 0.5)\n * {\n * Resolve(\"Success\");\n * }\n * else\n * {\n * Reject(\"Error\");\n * }\n * });\n *\n * Example.then(\n * (Value: string): void =>\n * {\n * // `Value` <- `\"Success\"`\n * },\n * (Reason: unknown): void =>\n * {\n * // `Reason` <- `\"Error\"`\n * }\n * );\n * ```\n */\n public Then<ResultType = ResolveType, RejectType = never>(OnFulfilled: TOnFulfilled<ResolveType, ResultType>, OnRejected?: TOnRejected<RejectType>): TPromise<ResultType | RejectType> {\n return new TPromise<ResultType | RejectType>(this.Underlying.then(OnFulfilled, OnRejected));\n }\n public override then<ResultType = ResolveType, RejectType = never>(OnFulfilled?: TOnFulfilled<ResolveType, ResultType>, OnRejected?: TOnRejected<RejectType>): TPromise<ResultType | RejectType> {\n return new TPromise<ResultType | RejectType>(this.Underlying.then(OnFulfilled, OnRejected));\n }\n public Catch<ResultType = never>(OnRejected?: TNullable<TOnRejected<ResolveType>>): TPromiseLike<ResolveType | ResultType> {\n return new TPromise<ResolveType | ResultType>(this.Underlying.catch(OnRejected));\n }\n public Finally(OnFinally?: TNullable<TFunction>): TPromise<ResolveType> {\n return new TPromise(this.Underlying.finally(OnFinally));\n }\n public static Resolve<ResolveType>(Value: ResolveType | PromiseLike<ResolveType>): TPromise<Awaited<ResolveType>> {\n return new TPromise(Promise.resolve(Value));\n }\n public static Reject<ResolveType = unknown>(Reason?: unknown): TPromise<ResolveType> {\n return new TPromise(Promise.reject<ResolveType>(Reason));\n }\n public Raw(): Promise<ResolveType> {\n return this.Underlying;\n }\n}\n;\n"],
|
|
5
|
+
"mappings": ";AAqEO,IAAM,0BAAN,cAAsC,MAAM;AAAA,EACxC,YAAY,WAAoB;AACnC,UAAM,SAAS;AAAA,EACnB;AACJ;;;AC/BA,eAAsB,IAAc,QAA6D;AAC7F,MAAI;AACA,UAAM,OAAiB,OAAO,WAAW,aACnC,MAAM,OAAO,IACb,MAAM;AACZ,WAAO;AAAA,MACH;AAAA,MACA,OAAO;AAAA,IACX;AAAA,EACJ,SACO,YAAqB;AACxB,WAAO;AAAA,MACH,MAAM;AAAA,MACN,OAAO;AAAA,IACX;AAAA,EACJ;AACJ;AAqBA,eAAsB,IAA4C,UAAsC,QAA2G;AAC/M,QAAM,gBAAgB,OAAO,YAA6D;AACtF,WAAO,OAAO,OAAO;AAAA,EACzB;AACA,QAAM,MAAyC,SAAS,IAAI,aAAa;AACzE,SAAO,MAAM,QAAQ,IAAI,GAAG;AAChC;AAKO,IAAe,eAAf,MAA6E;AAAA,EACzE,KAAmD,cAAsD,aAA8E;AAC1L,UAAM,IAAI,wBAAwB,cAAc;AAAA,EACpD;AACJ;AAWO,IAAM,6BAAN,cAAyC,UAAU;AAAA,EAC/C,cAAc;AACjB,UAAM;AAAA,EACV;AACJ;AAMO,IAAM,WAAN,MAAM,kBAA8B,aAA8D;AAAA,EAC9F,YAAY,UAA6C;AAC5D,UAAM;AACN,QAAI,OAAO,aAAa,YAAY;AAChC,WAAK,aAAa,IAAI,QAAqB,QAAQ;AAAA,IACvD,OACK;AACD,UAAI,oBAAoB,WAAU;AAC9B,aAAK,aAAa,SAAS,IAAI;AAAA,MACnC,WACS,oBAAoB,SAAS;AAClC,aAAK,aAAa;AAAA,MACtB;AAAA,IACJ;AACA,UAAM,IAAI,2BAA2B;AAAA,EACzC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA8CO,KAAmD,aAAoD,YAAyE;AACnL,WAAO,IAAI,UAAkC,KAAK,WAAW,KAAK,aAAa,UAAU,CAAC;AAAA,EAC9F;AAAA,EACgB,KAAmD,aAAqD,YAAyE;AAC7L,WAAO,IAAI,UAAkC,KAAK,WAAW,KAAK,aAAa,UAAU,CAAC;AAAA,EAC9F;AAAA,EACO,MAA0B,YAA0F;AACvH,WAAO,IAAI,UAAmC,KAAK,WAAW,MAAM,UAAU,CAAC;AAAA,EACnF;AAAA,EACO,QAAQ,WAAyD;AACpE,WAAO,IAAI,UAAS,KAAK,WAAW,QAAQ,SAAS,CAAC;AAAA,EAC1D;AAAA,EACA,OAAc,QAAqB,OAA+E;AAC9G,WAAO,IAAI,UAAS,QAAQ,QAAQ,KAAK,CAAC;AAAA,EAC9C;AAAA,EACA,OAAc,OAA8B,QAAyC;AACjF,WAAO,IAAI,UAAS,QAAQ,OAAoB,MAAM,CAAC;AAAA,EAC3D;AAAA,EACO,MAA4B;AAC/B,WAAO,KAAK;AAAA,EAChB;AACJ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
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/Math/Complex.ts
|
|
21
|
+
var Complex_exports = {};
|
|
22
|
+
__export(Complex_exports, {
|
|
23
|
+
FComplex: () => FComplex,
|
|
24
|
+
i: () => i
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(Complex_exports);
|
|
27
|
+
|
|
28
|
+
// Source/Math/Complex.Internal.ts
|
|
29
|
+
var MathBuiltin = Math;
|
|
30
|
+
|
|
31
|
+
// Source/Math/Complex.ts
|
|
32
|
+
var import_tsover_runtime = require("tsover-runtime");
|
|
33
|
+
var _FComplex = class _FComplex {
|
|
34
|
+
constructor(A, B = 0) {
|
|
35
|
+
if (typeof A === "number") {
|
|
36
|
+
this.Re = A;
|
|
37
|
+
this.Im = B;
|
|
38
|
+
} else {
|
|
39
|
+
this.Re = A.Re;
|
|
40
|
+
this.Im = A.Im;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Get the modulus of this {@link FComplex} number.
|
|
45
|
+
*
|
|
46
|
+
* @returns {number} The modulus of this {@link FComplex} number.
|
|
47
|
+
*/
|
|
48
|
+
get Mod() {
|
|
49
|
+
return MathBuiltin.sqrt(this.Re ** 2 + this.Im ** 2);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Get the modulus of this {@link FComplex} number.
|
|
53
|
+
*
|
|
54
|
+
* @returns {number} The modulus of this {@link FComplex} number.
|
|
55
|
+
*/
|
|
56
|
+
get Theta() {
|
|
57
|
+
const Out = MathBuiltin.atan2(this.Im, this.Re);
|
|
58
|
+
if (Out < 0) {
|
|
59
|
+
return Out + 2 * MathBuiltin.PI;
|
|
60
|
+
}
|
|
61
|
+
return Out;
|
|
62
|
+
}
|
|
63
|
+
[import_tsover_runtime.Operator.star](A, B) {
|
|
64
|
+
if (typeof A === "number") {
|
|
65
|
+
return new _FComplex(B.Re * A, B.Im * A);
|
|
66
|
+
} else if (typeof B === "number") {
|
|
67
|
+
return new _FComplex(A.Re * B, A.Im * B);
|
|
68
|
+
} else {
|
|
69
|
+
return new _FComplex(A.Re + B.Re - (A.Im + B.Im), A.Re + B.Im + (B.Re + A.Im));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
[import_tsover_runtime.Operator.plus](A, B) {
|
|
73
|
+
if (typeof A === "number") {
|
|
74
|
+
return new _FComplex(A + B.Re, B.Im);
|
|
75
|
+
} else if (typeof B === "number") {
|
|
76
|
+
return new _FComplex(A.Re + B, A.Im);
|
|
77
|
+
} else {
|
|
78
|
+
return new _FComplex(A.Re + B.Re, A.Im + B.Im);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
_FComplex.Zero = new _FComplex(0, 0);
|
|
83
|
+
var FComplex = _FComplex;
|
|
84
|
+
var i = new FComplex(0, 1);
|
|
85
|
+
/**
|
|
86
|
+
* @file Complex.Internal.ts
|
|
87
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
88
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
89
|
+
* @license MIT
|
|
90
|
+
*/
|
|
91
|
+
/**
|
|
92
|
+
* @file Complex.ts
|
|
93
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
94
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
95
|
+
* @license MIT
|
|
96
|
+
*/
|
|
97
|
+
//# sourceMappingURL=complex.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../Source/Math/Complex.ts", "../Source/Math/Complex.Internal.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * @file Complex.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nimport { MathBuiltin } from \"./Complex.Internal\";\nimport { Operator } from \"tsover-runtime\";\n/**\n * Elements of the complex plane, $\\mathbf{C} = \\mathbf{R}[x] / [ x^2 + 1 ]$.\n */\nexport class FComplex {\n public readonly Re: number;\n public readonly Im: number;\n public static Zero: FComplex = new FComplex(0, 0);\n /**\n * The copy constructor for {@link FComplex} numbers.\n *\n * @param Z - The existing {@link FComplex} number to copy.\n *\n * @example\n * ```typescript\n * const Z: FComplex = 3 + 2 * i;\n * const W: FComplex = new FComplex(Z);\n * // `W.Re === Z.Re` <- `true`\n * // `W.Im === Z.Im` <- `true`\n * ```\n */\n public constructor(Z: FComplex);\n /**\n * Construct an {@link FComplex} number by specifying the real\n * and imaginary components.\n *\n * @param A - The real component of the {@link FComplex} number.\n * @param B - The imaginary component of the {@link FComplex} number.\n *\n * @example\n * ```typescript\n * const Theta: number = 0.5;\n * const OnUnitDisk: FComplex = new FComplex(Math.sin(Theta), Math.cos(Theta));\n * ```\n */\n public constructor(A: number, B: number);\n public constructor(A: FComplex | number, B: number = 0) {\n if (typeof A === \"number\") {\n this.Re = A;\n this.Im = B;\n }\n else {\n this.Re = A.Re;\n this.Im = A.Im;\n }\n }\n /**\n * Get the modulus of this {@link FComplex} number.\n *\n * @returns {number} The modulus of this {@link FComplex} number.\n */\n public get Mod(): number {\n return MathBuiltin.sqrt((this.Re ** 2) + (this.Im ** 2));\n }\n /**\n * Get the modulus of this {@link FComplex} number.\n *\n * @returns {number} The modulus of this {@link FComplex} number.\n */\n public get Theta(): number {\n const Out: number = MathBuiltin.atan2(this.Im, this.Re);\n if (Out < 0) {\n return Out + 2 * MathBuiltin.PI;\n }\n return Out;\n }\n [Operator.star](A: FComplex, B: FComplex): FComplex;\n [Operator.star](A: FComplex, B: number): FComplex;\n [Operator.star](A: number, B: FComplex): FComplex;\n [Operator.star](A: FComplex | number, B: number | FComplex): FComplex {\n if (typeof A === \"number\") {\n return new FComplex((B as FComplex).Re * A, (B as FComplex).Im * A);\n }\n else if (typeof B === \"number\") {\n return new FComplex((A as FComplex).Re * B, (A as FComplex).Im * B);\n }\n else {\n return new FComplex((((A as FComplex).Re + (B as FComplex).Re) -\n ((A as FComplex).Im + (B as FComplex).Im)), (((A as FComplex).Re + (B as FComplex).Im) +\n ((B as FComplex).Re + (A as FComplex).Im)));\n }\n }\n [Operator.plus](A: FComplex, B: FComplex): FComplex;\n [Operator.plus](A: FComplex, B: number): FComplex;\n [Operator.plus](A: number, B: FComplex): FComplex;\n [Operator.plus](A: FComplex | number, B: number | FComplex): FComplex {\n if (typeof A === \"number\") {\n return new FComplex(A + (B as FComplex).Re, (B as FComplex).Im);\n }\n else if (typeof B === \"number\") {\n return new FComplex((A as FComplex).Re + B, (A as FComplex).Im);\n }\n else {\n return new FComplex((A as FComplex).Re + (B as FComplex).Re, (A as FComplex).Im + (B as FComplex).Im);\n }\n }\n}\nexport /**\n * The imaginary unit.\n */ const i: FComplex = new FComplex(0, 1);\n", "/**\n * @file Complex.Internal.ts\n * @author Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license MIT\n */\nexport const MathBuiltin: typeof Math = Math;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACMO,IAAM,cAA2B;;;ADCxC,4BAAyB;AAIlB,IAAM,YAAN,MAAM,UAAS;AAAA,EAgCX,YAAY,GAAsB,IAAY,GAAG;AACpD,QAAI,OAAO,MAAM,UAAU;AACvB,WAAK,KAAK;AACV,WAAK,KAAK;AAAA,IACd,OACK;AACD,WAAK,KAAK,EAAE;AACZ,WAAK,KAAK,EAAE;AAAA,IAChB;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAW,MAAc;AACrB,WAAO,YAAY,KAAM,KAAK,MAAM,IAAM,KAAK,MAAM,CAAE;AAAA,EAC3D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAW,QAAgB;AACvB,UAAM,MAAc,YAAY,MAAM,KAAK,IAAI,KAAK,EAAE;AACtD,QAAI,MAAM,GAAG;AACT,aAAO,MAAM,IAAI,YAAY;AAAA,IACjC;AACA,WAAO;AAAA,EACX;AAAA,EAIA,CAAC,+BAAS,IAAI,EAAE,GAAsB,GAAgC;AAClE,QAAI,OAAO,MAAM,UAAU;AACvB,aAAO,IAAI,UAAU,EAAe,KAAK,GAAI,EAAe,KAAK,CAAC;AAAA,IACtE,WACS,OAAO,MAAM,UAAU;AAC5B,aAAO,IAAI,UAAU,EAAe,KAAK,GAAI,EAAe,KAAK,CAAC;AAAA,IACtE,OACK;AACD,aAAO,IAAI,UAAY,EAAe,KAAM,EAAe,MACrD,EAAe,KAAM,EAAe,KAAS,EAAe,KAAM,EAAe,MACjF,EAAe,KAAM,EAAe,GAAI;AAAA,IAClD;AAAA,EACJ;AAAA,EAIA,CAAC,+BAAS,IAAI,EAAE,GAAsB,GAAgC;AAClE,QAAI,OAAO,MAAM,UAAU;AACvB,aAAO,IAAI,UAAS,IAAK,EAAe,IAAK,EAAe,EAAE;AAAA,IAClE,WACS,OAAO,MAAM,UAAU;AAC5B,aAAO,IAAI,UAAU,EAAe,KAAK,GAAI,EAAe,EAAE;AAAA,IAClE,OACK;AACD,aAAO,IAAI,UAAU,EAAe,KAAM,EAAe,IAAK,EAAe,KAAM,EAAe,EAAE;AAAA,IACxG;AAAA,EACJ;AACJ;AA5Fa,UAGK,OAAiB,IAAI,UAAS,GAAG,CAAC;AAH7C,IAAM,WAAN;AA+FG,IAAM,IAAc,IAAI,SAAS,GAAG,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// Source/Math/Complex.Internal.ts
|
|
2
|
+
var MathBuiltin = Math;
|
|
3
|
+
|
|
4
|
+
// Source/Math/Complex.ts
|
|
5
|
+
import { Operator } from "tsover-runtime";
|
|
6
|
+
var _FComplex = class _FComplex {
|
|
7
|
+
constructor(A, B = 0) {
|
|
8
|
+
if (typeof A === "number") {
|
|
9
|
+
this.Re = A;
|
|
10
|
+
this.Im = B;
|
|
11
|
+
} else {
|
|
12
|
+
this.Re = A.Re;
|
|
13
|
+
this.Im = A.Im;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Get the modulus of this {@link FComplex} number.
|
|
18
|
+
*
|
|
19
|
+
* @returns {number} The modulus of this {@link FComplex} number.
|
|
20
|
+
*/
|
|
21
|
+
get Mod() {
|
|
22
|
+
return MathBuiltin.sqrt(this.Re ** 2 + this.Im ** 2);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Get the modulus of this {@link FComplex} number.
|
|
26
|
+
*
|
|
27
|
+
* @returns {number} The modulus of this {@link FComplex} number.
|
|
28
|
+
*/
|
|
29
|
+
get Theta() {
|
|
30
|
+
const Out = MathBuiltin.atan2(this.Im, this.Re);
|
|
31
|
+
if (Out < 0) {
|
|
32
|
+
return Out + 2 * MathBuiltin.PI;
|
|
33
|
+
}
|
|
34
|
+
return Out;
|
|
35
|
+
}
|
|
36
|
+
[Operator.star](A, B) {
|
|
37
|
+
if (typeof A === "number") {
|
|
38
|
+
return new _FComplex(B.Re * A, B.Im * A);
|
|
39
|
+
} else if (typeof B === "number") {
|
|
40
|
+
return new _FComplex(A.Re * B, A.Im * B);
|
|
41
|
+
} else {
|
|
42
|
+
return new _FComplex(A.Re + B.Re - (A.Im + B.Im), A.Re + B.Im + (B.Re + A.Im));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
[Operator.plus](A, B) {
|
|
46
|
+
if (typeof A === "number") {
|
|
47
|
+
return new _FComplex(A + B.Re, B.Im);
|
|
48
|
+
} else if (typeof B === "number") {
|
|
49
|
+
return new _FComplex(A.Re + B, A.Im);
|
|
50
|
+
} else {
|
|
51
|
+
return new _FComplex(A.Re + B.Re, A.Im + B.Im);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
_FComplex.Zero = new _FComplex(0, 0);
|
|
56
|
+
var FComplex = _FComplex;
|
|
57
|
+
var i = new FComplex(0, 1);
|
|
58
|
+
export {
|
|
59
|
+
FComplex,
|
|
60
|
+
i
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* @file Complex.Internal.ts
|
|
64
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
65
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
66
|
+
* @license MIT
|
|
67
|
+
*/
|
|
68
|
+
/**
|
|
69
|
+
* @file Complex.ts
|
|
70
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
71
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
72
|
+
* @license MIT
|
|
73
|
+
*/
|
|
74
|
+
//# sourceMappingURL=complex.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../Source/Math/Complex.Internal.ts", "../Source/Math/Complex.ts"],
|
|
4
|
+
"sourcesContent": ["/**\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"],
|
|
5
|
+
"mappings": ";AAMO,IAAM,cAA2B;;;ACCxC,SAAS,gBAAgB;AAIlB,IAAM,YAAN,MAAM,UAAS;AAAA,EAgCX,YAAY,GAAsB,IAAY,GAAG;AACpD,QAAI,OAAO,MAAM,UAAU;AACvB,WAAK,KAAK;AACV,WAAK,KAAK;AAAA,IACd,OACK;AACD,WAAK,KAAK,EAAE;AACZ,WAAK,KAAK,EAAE;AAAA,IAChB;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAW,MAAc;AACrB,WAAO,YAAY,KAAM,KAAK,MAAM,IAAM,KAAK,MAAM,CAAE;AAAA,EAC3D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAW,QAAgB;AACvB,UAAM,MAAc,YAAY,MAAM,KAAK,IAAI,KAAK,EAAE;AACtD,QAAI,MAAM,GAAG;AACT,aAAO,MAAM,IAAI,YAAY;AAAA,IACjC;AACA,WAAO;AAAA,EACX;AAAA,EAIA,CAAC,SAAS,IAAI,EAAE,GAAsB,GAAgC;AAClE,QAAI,OAAO,MAAM,UAAU;AACvB,aAAO,IAAI,UAAU,EAAe,KAAK,GAAI,EAAe,KAAK,CAAC;AAAA,IACtE,WACS,OAAO,MAAM,UAAU;AAC5B,aAAO,IAAI,UAAU,EAAe,KAAK,GAAI,EAAe,KAAK,CAAC;AAAA,IACtE,OACK;AACD,aAAO,IAAI,UAAY,EAAe,KAAM,EAAe,MACrD,EAAe,KAAM,EAAe,KAAS,EAAe,KAAM,EAAe,MACjF,EAAe,KAAM,EAAe,GAAI;AAAA,IAClD;AAAA,EACJ;AAAA,EAIA,CAAC,SAAS,IAAI,EAAE,GAAsB,GAAgC;AAClE,QAAI,OAAO,MAAM,UAAU;AACvB,aAAO,IAAI,UAAS,IAAK,EAAe,IAAK,EAAe,EAAE;AAAA,IAClE,WACS,OAAO,MAAM,UAAU;AAC5B,aAAO,IAAI,UAAU,EAAe,KAAK,GAAI,EAAe,EAAE;AAAA,IAClE,OACK;AACD,aAAO,IAAI,UAAU,EAAe,KAAM,EAAe,IAAK,EAAe,KAAM,EAAe,EAAE;AAAA,IACxG;AAAA,EACJ;AACJ;AA5Fa,UAGK,OAAiB,IAAI,UAAS,GAAG,CAAC;AAH7C,IAAM,WAAN;AA+FG,IAAM,IAAc,IAAI,SAAS,GAAG,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|