@sorrell/utilities 1.1.61 → 1.2.0
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 +122 -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.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.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.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/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/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.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/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/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.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/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.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/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.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/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/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.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.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.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/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/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.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.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/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.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/Math.Internal.Types.d.cts +41 -0
- package/Distribution/Types/Math/Math.Internal.Types.d.cts.map +10 -0
- package/Distribution/Types/Math/Math.Internal.Types.d.mts +41 -0
- package/Distribution/Types/Math/Math.Internal.Types.d.mts.map +10 -0
- package/Distribution/Types/Math/Math.Types.d.cts +90 -0
- package/Distribution/Types/Math/Math.Types.d.cts.map +10 -0
- package/Distribution/Types/Math/Math.Types.d.mts +90 -0
- package/Distribution/Types/Math/Math.Types.d.mts.map +10 -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/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/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/Miscellaneous/Utility.Internal.d.cts +8 -0
- package/Distribution/Types/Miscellaneous/Utility.Internal.d.cts.map +10 -0
- package/Distribution/Types/Miscellaneous/Utility.Internal.d.mts +8 -0
- package/Distribution/Types/Miscellaneous/Utility.Internal.d.mts.map +10 -0
- package/Distribution/Types/Miscellaneous/Utility.Types.d.cts +100 -0
- package/Distribution/Types/Miscellaneous/Utility.Types.d.cts.map +10 -0
- package/Distribution/Types/Miscellaneous/Utility.Types.d.mts +100 -0
- package/Distribution/Types/Miscellaneous/Utility.Types.d.mts.map +10 -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/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/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.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.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.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.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/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/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/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/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/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/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/{CJS/array.js → array.cjs} +1 -1
- package/Distribution/{CJS/array.js.map → array.cjs.map} +1 -1
- package/Distribution/{ESM/array.js.map → array.js.map} +1 -1
- package/Distribution/{CJS/async.js → async.cjs} +1 -1
- package/Distribution/{CJS/async.js.map → async.cjs.map} +1 -1
- package/Distribution/{ESM/async.js.map → async.js.map} +1 -1
- package/Distribution/{CJS/complex.js → complex.cjs} +1 -1
- package/Distribution/{CJS/complex.js.map → complex.cjs.map} +1 -1
- package/Distribution/{ESM/complex.js.map → complex.js.map} +1 -1
- package/Distribution/{CJS/effect.js → effect.cjs} +1 -1
- package/Distribution/{CJS/effect.js.map → effect.cjs.map} +1 -1
- package/Distribution/{ESM/effect.js.map → effect.js.map} +1 -1
- package/Distribution/{CJS/fs.js → fs.cjs} +1 -1
- package/Distribution/{CJS/fs.js.map → fs.cjs.map} +1 -1
- package/Distribution/{ESM/fs.js.map → fs.js.map} +1 -1
- package/Distribution/{CJS/functional.js → functional.cjs} +1 -1
- package/Distribution/{CJS/functional.js.map → functional.cjs.map} +1 -1
- package/Distribution/{ESM/functional.js.map → functional.js.map} +1 -1
- package/Distribution/{CJS/index.js → index.cjs} +1 -1
- package/Distribution/{CJS/index.js.map → index.cjs.map} +1 -1
- package/Distribution/{ESM/index.js.map → index.js.map} +1 -1
- package/Distribution/{CJS/math.js → math.cjs} +1 -1
- package/Distribution/{CJS/math.js.map → math.cjs.map} +1 -1
- package/Distribution/{ESM/math.js.map → math.js.map} +1 -1
- package/Distribution/{CJS/misc.js → misc.cjs} +1 -1
- package/Distribution/{CJS/misc.js.map → misc.cjs.map} +1 -1
- package/Distribution/{ESM/misc.js.map → misc.js.map} +1 -1
- package/Distribution/{CJS/npm-effect.js → npm-effect.cjs} +1 -1
- package/Distribution/{CJS/npm-effect.js.map → npm-effect.cjs.map} +1 -1
- package/Distribution/{ESM/npm-effect.js.map → npm-effect.js.map} +1 -1
- package/Distribution/{CJS/npm.js → npm.cjs} +1 -1
- package/Distribution/{CJS/npm.js.map → npm.cjs.map} +1 -1
- package/Distribution/{ESM/npm.js.map → npm.js.map} +1 -1
- package/Distribution/{CJS/path.js → path.cjs} +1 -1
- package/Distribution/{CJS/path.js.map → path.cjs.map} +1 -1
- package/Distribution/{ESM/path.js.map → path.js.map} +1 -1
- package/package.json +100 -50
- /package/Distribution/{ESM/array.js → array.js} +0 -0
- /package/Distribution/{ESM/async.js → async.js} +0 -0
- /package/Distribution/{ESM/complex.js → complex.js} +0 -0
- /package/Distribution/{ESM/effect.js → effect.js} +0 -0
- /package/Distribution/{ESM/fs.js → fs.js} +0 -0
- /package/Distribution/{ESM/functional.js → functional.js} +0 -0
- /package/Distribution/{ESM/index.js → index.js} +0 -0
- /package/Distribution/{ESM/math.js → math.js} +0 -0
- /package/Distribution/{ESM/misc.js → misc.js} +0 -0
- /package/Distribution/{ESM/npm-effect.js → npm-effect.js} +0 -0
- /package/Distribution/{ESM/npm.js → npm.js} +0 -0
- /package/Distribution/{ESM/path.js → path.js} +0 -0
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Utility.Types.ts
|
|
3
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
4
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
5
|
+
* @license MIT
|
|
6
|
+
*/
|
|
7
|
+
import type * as TypeScript from "typescript";
|
|
8
|
+
import type { NoOptions } from "./Utility.Internal.cjs";
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Use {@link TMutable} instead.
|
|
11
|
+
*
|
|
12
|
+
* Defines a type that corresponds to {@link RecordLike}, such that every
|
|
13
|
+
* `readonly` modifier is removed, recursively.
|
|
14
|
+
*
|
|
15
|
+
* @template RecordLike - The type to make writeable.
|
|
16
|
+
*/
|
|
17
|
+
export type TDeepWriteable<RecordLike> = {
|
|
18
|
+
-readonly [Key in keyof RecordLike]: TDeepWriteable<RecordLike[Key]>;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Defines a type that corresponds to {@link RecordLike}, such that every
|
|
22
|
+
* `readonly` modifier is removed, recursively.
|
|
23
|
+
*
|
|
24
|
+
* @template RecordLike - The type to make writeable.
|
|
25
|
+
* @template ShallowOption - Whether the `readonly` modifier should be stripped recursively.
|
|
26
|
+
* If `true` (the default), then only the properties of the given type will have the `readonly`
|
|
27
|
+
* modifier stripped (that is, if any of these properties is a {@link Record} type with `readonly`
|
|
28
|
+
* modifiers, then those will *not* be removed if {@link ShallowOption} is `true`).
|
|
29
|
+
*/
|
|
30
|
+
export type TMutable<RecordLike, ShallowOption extends boolean = true> = ShallowOption extends false ? {
|
|
31
|
+
-readonly [Key in keyof RecordLike]: RecordLike[Key];
|
|
32
|
+
} : ShallowOption extends true ? {
|
|
33
|
+
-readonly [Key in keyof RecordLike]: TMutable<RecordLike[Key]>;
|
|
34
|
+
} : never;
|
|
35
|
+
/**
|
|
36
|
+
* Given a {@link RecordLike | record-like type}, this type is the union
|
|
37
|
+
* of the values of all properties in the {@link RecordLike | record-like type}.
|
|
38
|
+
*
|
|
39
|
+
* @template RecordLike - The record-like type from which this type extracts value types.
|
|
40
|
+
*/
|
|
41
|
+
export type TValues<RecordLike> = RecordLike[keyof RecordLike];
|
|
42
|
+
/**
|
|
43
|
+
* The union of a given {@link ElementType} and the array of a given {@link ElementType}.
|
|
44
|
+
*
|
|
45
|
+
* @template ElementType - The type of this, or the type of elements contained by this.
|
|
46
|
+
*/
|
|
47
|
+
export type TMaybeArray<ElementType> = ElementType | Array<ElementType>;
|
|
48
|
+
/**
|
|
49
|
+
* The element type of the return value of `Object.entries()`.
|
|
50
|
+
*
|
|
51
|
+
* @template RecordLike - The record-like type of the argument of `Object.entries()`.
|
|
52
|
+
* @template KeyType - The subset of keys used by this type.
|
|
53
|
+
*/
|
|
54
|
+
export type TEntry<RecordLike, KeyType extends keyof RecordLike = keyof RecordLike> = [KeyType, RecordLike[KeyType]];
|
|
55
|
+
/** The type used in `OptionsType`s when no options are specified. */
|
|
56
|
+
export type NoOptions = typeof NoOptions;
|
|
57
|
+
/**
|
|
58
|
+
* Define options for a given type as a union of `unique symbol` types.
|
|
59
|
+
* All options must be *optional* by the type that uses these options.
|
|
60
|
+
* The type that uses these options should have a type parameter `OptionsType`
|
|
61
|
+
* defined with `OptionsType extends TOptions = NoOptions`. You will have to import
|
|
62
|
+
* {@link NoOptions}, but this should be done anyway, since making all options types
|
|
63
|
+
* optional should be optional. For this reason {@link NoOptions} is exported from the
|
|
64
|
+
* same module as this type.
|
|
65
|
+
*
|
|
66
|
+
* @template OptionsType - The `unique symbol` types that act as options.
|
|
67
|
+
*
|
|
68
|
+
* @example * See the {@link Array.Options:type} type as an example.
|
|
69
|
+
*/
|
|
70
|
+
export type TOptions<OptionsType extends symbol = NoOptions> = OptionsType | NoOptions;
|
|
71
|
+
export type TNullable<Type> = Type | null | undefined;
|
|
72
|
+
export declare class AbstractMethodCallError extends Error {
|
|
73
|
+
constructor(ClassName?: string);
|
|
74
|
+
}
|
|
75
|
+
/** The type corresponding to the schema of `tsconfig.json`. */
|
|
76
|
+
export interface FTsConfig {
|
|
77
|
+
extends?: string | Array<string>;
|
|
78
|
+
files?: Array<string>;
|
|
79
|
+
include?: Array<string>;
|
|
80
|
+
exclude?: Array<string>;
|
|
81
|
+
references?: Array<TypeScript.ProjectReference>;
|
|
82
|
+
compilerOptions?: FCompilerOptions;
|
|
83
|
+
watchOptions?: TypeScript.WatchOptions;
|
|
84
|
+
typeAcquisition?: TypeScript.TypeAcquisition;
|
|
85
|
+
compileOnSave?: boolean;
|
|
86
|
+
}
|
|
87
|
+
type FOverriddenCompilerOptions = "jsx" | "lib" | "module" | "moduleResolution" | "target";
|
|
88
|
+
type FCompilerOptions = Omit<TypeScript.server.protocol.CompilerOptions, FOverriddenCompilerOptions> & Partial<{
|
|
89
|
+
jsx: JsxEmit;
|
|
90
|
+
lib: Array<string>;
|
|
91
|
+
module: FModuleKind;
|
|
92
|
+
moduleResolution: FModuleResolutionKind;
|
|
93
|
+
target: FTarget;
|
|
94
|
+
}>;
|
|
95
|
+
type JsxEmit = "none" | "preserve" | "react-native" | "react" | "react-jsx" | "react-jsxdev";
|
|
96
|
+
type FModuleKind = "none" | "commonjs" | "amd" | "umd" | "system" | "es6" | "es2015" | "es2020" | "es2022" | "esnext" | "node16" | "node18" | "node20" | "nodenext" | "preserve";
|
|
97
|
+
type FModuleResolutionKind = "classic" | "node" | "node" | "node10" | "node16" | "nodenext" | "bundler";
|
|
98
|
+
export type FTarget = "es3" | "es5" | "es6" | "es2015" | "es2016" | "es2017" | "es2018" | "es2019" | "es2020" | "es2021" | "es2022" | "es2023" | "es2024" | "es2025" | "esnext" | "json" | "esnext" | "es2025";
|
|
99
|
+
export {};
|
|
100
|
+
//# sourceMappingURL=Utility.Types.d.cts.map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AAEP,KAAK,OAAO,GACN,MAAM,GACN,UAAU,GACV,cAAc,GACd,OAAO,GACP,WAAW,GACX,cAAc,CAAC;AAErB,KAAK,WAAW,GACV,MAAM,GACN,UAAU,GACV,KAAK,GACL,KAAK,GACL,QAAQ,GACR,KAAK,GACL,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,UAAU,GACV,UAAU,CAAC;AAEjB,KAAK,qBAAqB,GACpB,SAAS,GACT,MAAM,GACN,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,UAAU,GACV,SAAS,CAAC;AAEhB,MAAM,MAAM,OAAO,GACb,KAAK,GACL,KAAK,GACL,KAAK,GACL,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,QAAQ,GACR,QAAQ,CAAC"
|
|
10
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Utility.Types.ts
|
|
3
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
4
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
5
|
+
* @license MIT
|
|
6
|
+
*/
|
|
7
|
+
import type * as TypeScript from "typescript";
|
|
8
|
+
import type { NoOptions } from "./Utility.Internal.mjs";
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Use {@link TMutable} instead.
|
|
11
|
+
*
|
|
12
|
+
* Defines a type that corresponds to {@link RecordLike}, such that every
|
|
13
|
+
* `readonly` modifier is removed, recursively.
|
|
14
|
+
*
|
|
15
|
+
* @template RecordLike - The type to make writeable.
|
|
16
|
+
*/
|
|
17
|
+
export type TDeepWriteable<RecordLike> = {
|
|
18
|
+
-readonly [Key in keyof RecordLike]: TDeepWriteable<RecordLike[Key]>;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Defines a type that corresponds to {@link RecordLike}, such that every
|
|
22
|
+
* `readonly` modifier is removed, recursively.
|
|
23
|
+
*
|
|
24
|
+
* @template RecordLike - The type to make writeable.
|
|
25
|
+
* @template ShallowOption - Whether the `readonly` modifier should be stripped recursively.
|
|
26
|
+
* If `true` (the default), then only the properties of the given type will have the `readonly`
|
|
27
|
+
* modifier stripped (that is, if any of these properties is a {@link Record} type with `readonly`
|
|
28
|
+
* modifiers, then those will *not* be removed if {@link ShallowOption} is `true`).
|
|
29
|
+
*/
|
|
30
|
+
export type TMutable<RecordLike, ShallowOption extends boolean = true> = ShallowOption extends false ? {
|
|
31
|
+
-readonly [Key in keyof RecordLike]: RecordLike[Key];
|
|
32
|
+
} : ShallowOption extends true ? {
|
|
33
|
+
-readonly [Key in keyof RecordLike]: TMutable<RecordLike[Key]>;
|
|
34
|
+
} : never;
|
|
35
|
+
/**
|
|
36
|
+
* Given a {@link RecordLike | record-like type}, this type is the union
|
|
37
|
+
* of the values of all properties in the {@link RecordLike | record-like type}.
|
|
38
|
+
*
|
|
39
|
+
* @template RecordLike - The record-like type from which this type extracts value types.
|
|
40
|
+
*/
|
|
41
|
+
export type TValues<RecordLike> = RecordLike[keyof RecordLike];
|
|
42
|
+
/**
|
|
43
|
+
* The union of a given {@link ElementType} and the array of a given {@link ElementType}.
|
|
44
|
+
*
|
|
45
|
+
* @template ElementType - The type of this, or the type of elements contained by this.
|
|
46
|
+
*/
|
|
47
|
+
export type TMaybeArray<ElementType> = ElementType | Array<ElementType>;
|
|
48
|
+
/**
|
|
49
|
+
* The element type of the return value of `Object.entries()`.
|
|
50
|
+
*
|
|
51
|
+
* @template RecordLike - The record-like type of the argument of `Object.entries()`.
|
|
52
|
+
* @template KeyType - The subset of keys used by this type.
|
|
53
|
+
*/
|
|
54
|
+
export type TEntry<RecordLike, KeyType extends keyof RecordLike = keyof RecordLike> = [KeyType, RecordLike[KeyType]];
|
|
55
|
+
/** The type used in `OptionsType`s when no options are specified. */
|
|
56
|
+
export type NoOptions = typeof NoOptions;
|
|
57
|
+
/**
|
|
58
|
+
* Define options for a given type as a union of `unique symbol` types.
|
|
59
|
+
* All options must be *optional* by the type that uses these options.
|
|
60
|
+
* The type that uses these options should have a type parameter `OptionsType`
|
|
61
|
+
* defined with `OptionsType extends TOptions = NoOptions`. You will have to import
|
|
62
|
+
* {@link NoOptions}, but this should be done anyway, since making all options types
|
|
63
|
+
* optional should be optional. For this reason {@link NoOptions} is exported from the
|
|
64
|
+
* same module as this type.
|
|
65
|
+
*
|
|
66
|
+
* @template OptionsType - The `unique symbol` types that act as options.
|
|
67
|
+
*
|
|
68
|
+
* @example * See the {@link Array.Options:type} type as an example.
|
|
69
|
+
*/
|
|
70
|
+
export type TOptions<OptionsType extends symbol = NoOptions> = OptionsType | NoOptions;
|
|
71
|
+
export type TNullable<Type> = Type | null | undefined;
|
|
72
|
+
export declare class AbstractMethodCallError extends Error {
|
|
73
|
+
constructor(ClassName?: string);
|
|
74
|
+
}
|
|
75
|
+
/** The type corresponding to the schema of `tsconfig.json`. */
|
|
76
|
+
export interface FTsConfig {
|
|
77
|
+
extends?: string | Array<string>;
|
|
78
|
+
files?: Array<string>;
|
|
79
|
+
include?: Array<string>;
|
|
80
|
+
exclude?: Array<string>;
|
|
81
|
+
references?: Array<TypeScript.ProjectReference>;
|
|
82
|
+
compilerOptions?: FCompilerOptions;
|
|
83
|
+
watchOptions?: TypeScript.WatchOptions;
|
|
84
|
+
typeAcquisition?: TypeScript.TypeAcquisition;
|
|
85
|
+
compileOnSave?: boolean;
|
|
86
|
+
}
|
|
87
|
+
type FOverriddenCompilerOptions = "jsx" | "lib" | "module" | "moduleResolution" | "target";
|
|
88
|
+
type FCompilerOptions = Omit<TypeScript.server.protocol.CompilerOptions, FOverriddenCompilerOptions> & Partial<{
|
|
89
|
+
jsx: JsxEmit;
|
|
90
|
+
lib: Array<string>;
|
|
91
|
+
module: FModuleKind;
|
|
92
|
+
moduleResolution: FModuleResolutionKind;
|
|
93
|
+
target: FTarget;
|
|
94
|
+
}>;
|
|
95
|
+
type JsxEmit = "none" | "preserve" | "react-native" | "react" | "react-jsx" | "react-jsxdev";
|
|
96
|
+
type FModuleKind = "none" | "commonjs" | "amd" | "umd" | "system" | "es6" | "es2015" | "es2020" | "es2022" | "esnext" | "node16" | "node18" | "node20" | "nodenext" | "preserve";
|
|
97
|
+
type FModuleResolutionKind = "classic" | "node" | "node" | "node10" | "node16" | "nodenext" | "bundler";
|
|
98
|
+
export type FTarget = "es3" | "es5" | "es6" | "es2015" | "es2016" | "es2017" | "es2018" | "es2019" | "es2020" | "es2021" | "es2022" | "es2023" | "es2024" | "es2025" | "esnext" | "json" | "esnext" | "es2025";
|
|
99
|
+
export {};
|
|
100
|
+
//# sourceMappingURL=Utility.Types.d.mts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"file": "Utility.Types.d.mts",
|
|
4
|
+
"sourceRoot": "",
|
|
5
|
+
"sources": [
|
|
6
|
+
"../../../Source/Miscellaneous/Utility.Types.ts"
|
|
7
|
+
],
|
|
8
|
+
"names": [],
|
|
9
|
+
"mappings": "AAAA;;;;;GAKG;AAEH,OAAO,KAAK,KAAK,UAAU,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD;;;;;;;GAOG;AACH,MAAM,MAAM,cAAc,CAAC,UAAU,IACjC;IACI,CAAC,UAAW,GAAG,IAAI,MAAM,UAAU,GAAI,cAAc,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;CACzE,CAAC;AAEN;;;;;;;;;GASG;AACH,MAAM,MAAM,QAAQ,CAAC,UAAU,EAAE,aAAa,SAAS,OAAO,GAAG,IAAI,IACjE,aAAa,SAAS,KAAK,GACrB;IACE,CAAC,UAAW,GAAG,IAAI,MAAM,UAAU,GAAI,UAAU,CAAC,GAAG,CAAC;CACzD,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al.ts
|
|
3
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
4
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
5
|
+
* @license MIT
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Returns whether a given {@link Value} contains a `readonly` `string` `"code"`.
|
|
9
|
+
*
|
|
10
|
+
* @param Value - The value to test.
|
|
11
|
+
* @returns {Value is { readonly code: string }} Whether {@link Value} is a
|
|
12
|
+
* `{ readonly code: string }`.
|
|
13
|
+
*/
|
|
14
|
+
export declare function HasErrorCode(Value: unknown): Value is {
|
|
15
|
+
readonly code: string;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=Npm.Effect.Internal.d.cts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"file": "Npm.Effect.Internal.d.cts",
|
|
4
|
+
"sourceRoot": "",
|
|
5
|
+
"sources": [
|
|
6
|
+
"../../../Source/Npm/Npm.Effect.Internal.ts"
|
|
7
|
+
],
|
|
8
|
+
"names": [],
|
|
9
|
+
"mappings": "AAAA;;;;;GAKG;AAIH;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAM/E"
|
|
10
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Npm.Effect.Internal.ts
|
|
3
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
4
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
5
|
+
* @license MIT
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Returns whether a given {@link Value} contains a `readonly` `string` `"code"`.
|
|
9
|
+
*
|
|
10
|
+
* @param Value - The value to test.
|
|
11
|
+
* @returns {Value is { readonly code: string }} Whether {@link Value} is a
|
|
12
|
+
* `{ readonly code: string }`.
|
|
13
|
+
*/
|
|
14
|
+
export declare function HasErrorCode(Value: unknown): Value is {
|
|
15
|
+
readonly code: string;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=Npm.Effect.Internal.d.mts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"file": "Npm.Effect.Internal.d.mts",
|
|
4
|
+
"sourceRoot": "",
|
|
5
|
+
"sources": [
|
|
6
|
+
"../../../Source/Npm/Npm.Effect.Internal.ts"
|
|
7
|
+
],
|
|
8
|
+
"names": [],
|
|
9
|
+
"mappings": "AAAA;;;;;GAKG;AAIH;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAM/E"
|
|
10
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Npm.Effect.Types.ts
|
|
3
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
4
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
5
|
+
* @license MIT
|
|
6
|
+
*/
|
|
7
|
+
import type { PackageJsonParseError, RootDirectoryNotFoundError } from "./Npm.Error.cjs";
|
|
8
|
+
import type { Effect } from "effect";
|
|
9
|
+
import type { IPackageJson } from "package-json-type";
|
|
10
|
+
export type EGetPackageJson = Effect.Effect<IPackageJson, PackageJsonParseError | RootDirectoryNotFoundError, never>;
|
|
11
|
+
export type EGetPackageRootDirectory = Effect.Effect<string, RootDirectoryNotFoundError, never>;
|
|
12
|
+
//# sourceMappingURL=Npm.Effect.Types.d.cts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"file": "Npm.Effect.Types.d.cts",
|
|
4
|
+
"sourceRoot": "",
|
|
5
|
+
"sources": [
|
|
6
|
+
"../../../Source/Npm/Npm.Effect.Types.ts"
|
|
7
|
+
],
|
|
8
|
+
"names": [],
|
|
9
|
+
"mappings": "AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AACxF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,MAAM,MAAM,eAAe,GACvB,MAAM,CAAC,MAAM,CACT,YAAY,EACZ,qBAAqB,GAAG,0BAA0B,EAClD,KAAK,CACR,CAAC;AAEN,MAAM,MAAM,wBAAwB,GAChC,MAAM,CAAC,MAAM,CACT,MAAM,EACN,0BAA0B,EAC1B,KAAK,CACR,CAAC"
|
|
10
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Npm.Effect.Types.ts
|
|
3
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
4
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
5
|
+
* @license MIT
|
|
6
|
+
*/
|
|
7
|
+
import type { PackageJsonParseError, RootDirectoryNotFoundError } from "./Npm.Error.mjs";
|
|
8
|
+
import type { Effect } from "effect";
|
|
9
|
+
import type { IPackageJson } from "package-json-type";
|
|
10
|
+
export type EGetPackageJson = Effect.Effect<IPackageJson, PackageJsonParseError | RootDirectoryNotFoundError, never>;
|
|
11
|
+
export type EGetPackageRootDirectory = Effect.Effect<string, RootDirectoryNotFoundError, never>;
|
|
12
|
+
//# sourceMappingURL=Npm.Effect.Types.d.mts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"file": "Npm.Effect.Types.d.mts",
|
|
4
|
+
"sourceRoot": "",
|
|
5
|
+
"sources": [
|
|
6
|
+
"../../../Source/Npm/Npm.Effect.Types.ts"
|
|
7
|
+
],
|
|
8
|
+
"names": [],
|
|
9
|
+
"mappings": "AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AACxF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,MAAM,MAAM,eAAe,GACvB,MAAM,CAAC,MAAM,CACT,YAAY,EACZ,qBAAqB,GAAG,0BAA0B,EAClD,KAAK,CACR,CAAC;AAEN,MAAM,MAAM,wBAAwB,GAChC,MAAM,CAAC,MAAM,CACT,MAAM,EACN,0BAA0B,EAC1B,KAAK,CACR,CAAC"
|
|
10
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Npm.Effect.ts
|
|
3
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
4
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
5
|
+
* @license MIT
|
|
6
|
+
*/
|
|
7
|
+
import type { EGetPackageJson, EGetPackageRootDirectory } from "./Npm.Effect.Types.cjs";
|
|
8
|
+
/**
|
|
9
|
+
* Get the `package.json` of the Node.js project in which the
|
|
10
|
+
* given path, or the current working directory, resides.
|
|
11
|
+
*
|
|
12
|
+
* @param Path - The given path from which to look for a root directory.
|
|
13
|
+
*
|
|
14
|
+
* @returns {EGetPackageJson} An Effect that succeeds with the parsed `package.json`, or fails
|
|
15
|
+
* with {@link RootDirectoryNotFoundError} or {@link PackageJsonParseError}.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* Suppose `process.cwd() === "./MyPackage"`,
|
|
19
|
+
* ```typescript
|
|
20
|
+
* Effect.gen(function* ()
|
|
21
|
+
* {
|
|
22
|
+
* const PackageJson: IPackageJson = yield* GetPackageJson();
|
|
23
|
+
* // `PackageJson` <- *The parsed `package.json` of `MyPackage`.*
|
|
24
|
+
* }
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare function GetPackageJson(Path?: string): EGetPackageJson;
|
|
28
|
+
/**
|
|
29
|
+
* Get the root directory of the Node.js project in which the
|
|
30
|
+
* current working directory resides.
|
|
31
|
+
*
|
|
32
|
+
* @param Path - *(Optional)* The given path from which to look for a root directory.
|
|
33
|
+
*
|
|
34
|
+
* @returns {EGetPackageRootDirectory} An Effect that succeeds with the package root
|
|
35
|
+
* directory, or fails with {@link RootDirectoryNotFoundError}.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* Suppose `process.cwd()` is any one of the following,
|
|
39
|
+
* - `/home/alex/myPackage`,
|
|
40
|
+
* - `/home/alex/myPackage/src/MyModule`,
|
|
41
|
+
* - `/home/alex/myPackage/resource/Images`,
|
|
42
|
+
*
|
|
43
|
+
* then,
|
|
44
|
+
*
|
|
45
|
+
* ```typescript
|
|
46
|
+
* import { Effect } from "effect";
|
|
47
|
+
* const Root: string = await Effect.runPromise(GetPackageRootDirectory());
|
|
48
|
+
* // `Root` <- `"/home/alex/myPackage"`
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* Suppose `TestPath === "/home/alex/Documents"` is *not* a NodeJS package root
|
|
53
|
+
* (of course, neither are `/home/alex` or `/home`). Then,
|
|
54
|
+
*
|
|
55
|
+
* ```typescript
|
|
56
|
+
* import { Effect } from "effect";
|
|
57
|
+
* const TestPath: string = "/home/alex/Documents";
|
|
58
|
+
* let Root: string | undefined = undefined;
|
|
59
|
+
* try
|
|
60
|
+
* {
|
|
61
|
+
* Root = await Effect.runPromise(
|
|
62
|
+
* GetPackageRootDirectory(TestPath)
|
|
63
|
+
* );
|
|
64
|
+
* }
|
|
65
|
+
* catch (Error: unknown)
|
|
66
|
+
* {
|
|
67
|
+
* // `Error instanceof RootDirectoryNotFound`
|
|
68
|
+
* }
|
|
69
|
+
*
|
|
70
|
+
* // `Root` <- `undefined`
|
|
71
|
+
* ```
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* Suppose `process.cwd() === /home/alex/Downloads`, which is *not* a NodeJS package
|
|
75
|
+
* (of course, neither are `/home/alex` or `/home`). Then,
|
|
76
|
+
*
|
|
77
|
+
* ```typescript
|
|
78
|
+
* import { Effect } from "effect";
|
|
79
|
+
* let Root: string | undefined = undefined;
|
|
80
|
+
* try
|
|
81
|
+
* {
|
|
82
|
+
* Root = await Effect.runPromise(GetPackageRootDirectory());
|
|
83
|
+
* }
|
|
84
|
+
* catch (Error: unknown)
|
|
85
|
+
* {
|
|
86
|
+
* // `Error instanceof RootDirectoryNotFound`
|
|
87
|
+
* }
|
|
88
|
+
* // `Root` <- `undefined`
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
export declare function GetPackageRootDirectory(Path?: string): EGetPackageRootDirectory;
|
|
92
|
+
//# sourceMappingURL=Npm.Effect.d.cts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"file": "Npm.Effect.d.cts",
|
|
4
|
+
"sourceRoot": "",
|
|
5
|
+
"sources": [
|
|
6
|
+
"../../../Source/Npm/Npm.Effect.ts"
|
|
7
|
+
],
|
|
8
|
+
"names": [],
|
|
9
|
+
"mappings": "AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AASvF;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,cAAc,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,eAAe,CAyB7D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,wBAAwB,CA6C/E"
|
|
10
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Npm.Effect.ts
|
|
3
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
4
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
5
|
+
* @license MIT
|
|
6
|
+
*/
|
|
7
|
+
import type { EGetPackageJson, EGetPackageRootDirectory } from "./Npm.Effect.Types.mjs";
|
|
8
|
+
/**
|
|
9
|
+
* Get the `package.json` of the Node.js project in which the
|
|
10
|
+
* given path, or the current working directory, resides.
|
|
11
|
+
*
|
|
12
|
+
* @param Path - The given path from which to look for a root directory.
|
|
13
|
+
*
|
|
14
|
+
* @returns {EGetPackageJson} An Effect that succeeds with the parsed `package.json`, or fails
|
|
15
|
+
* with {@link RootDirectoryNotFoundError} or {@link PackageJsonParseError}.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* Suppose `process.cwd() === "./MyPackage"`,
|
|
19
|
+
* ```typescript
|
|
20
|
+
* Effect.gen(function* ()
|
|
21
|
+
* {
|
|
22
|
+
* const PackageJson: IPackageJson = yield* GetPackageJson();
|
|
23
|
+
* // `PackageJson` <- *The parsed `package.json` of `MyPackage`.*
|
|
24
|
+
* }
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare function GetPackageJson(Path?: string): EGetPackageJson;
|
|
28
|
+
/**
|
|
29
|
+
* Get the root directory of the Node.js project in which the
|
|
30
|
+
* current working directory resides.
|
|
31
|
+
*
|
|
32
|
+
* @param Path - *(Optional)* The given path from which to look for a root directory.
|
|
33
|
+
*
|
|
34
|
+
* @returns {EGetPackageRootDirectory} An Effect that succeeds with the package root
|
|
35
|
+
* directory, or fails with {@link RootDirectoryNotFoundError}.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* Suppose `process.cwd()` is any one of the following,
|
|
39
|
+
* - `/home/alex/myPackage`,
|
|
40
|
+
* - `/home/alex/myPackage/src/MyModule`,
|
|
41
|
+
* - `/home/alex/myPackage/resource/Images`,
|
|
42
|
+
*
|
|
43
|
+
* then,
|
|
44
|
+
*
|
|
45
|
+
* ```typescript
|
|
46
|
+
* import { Effect } from "effect";
|
|
47
|
+
* const Root: string = await Effect.runPromise(GetPackageRootDirectory());
|
|
48
|
+
* // `Root` <- `"/home/alex/myPackage"`
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* Suppose `TestPath === "/home/alex/Documents"` is *not* a NodeJS package root
|
|
53
|
+
* (of course, neither are `/home/alex` or `/home`). Then,
|
|
54
|
+
*
|
|
55
|
+
* ```typescript
|
|
56
|
+
* import { Effect } from "effect";
|
|
57
|
+
* const TestPath: string = "/home/alex/Documents";
|
|
58
|
+
* let Root: string | undefined = undefined;
|
|
59
|
+
* try
|
|
60
|
+
* {
|
|
61
|
+
* Root = await Effect.runPromise(
|
|
62
|
+
* GetPackageRootDirectory(TestPath)
|
|
63
|
+
* );
|
|
64
|
+
* }
|
|
65
|
+
* catch (Error: unknown)
|
|
66
|
+
* {
|
|
67
|
+
* // `Error instanceof RootDirectoryNotFound`
|
|
68
|
+
* }
|
|
69
|
+
*
|
|
70
|
+
* // `Root` <- `undefined`
|
|
71
|
+
* ```
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* Suppose `process.cwd() === /home/alex/Downloads`, which is *not* a NodeJS package
|
|
75
|
+
* (of course, neither are `/home/alex` or `/home`). Then,
|
|
76
|
+
*
|
|
77
|
+
* ```typescript
|
|
78
|
+
* import { Effect } from "effect";
|
|
79
|
+
* let Root: string | undefined = undefined;
|
|
80
|
+
* try
|
|
81
|
+
* {
|
|
82
|
+
* Root = await Effect.runPromise(GetPackageRootDirectory());
|
|
83
|
+
* }
|
|
84
|
+
* catch (Error: unknown)
|
|
85
|
+
* {
|
|
86
|
+
* // `Error instanceof RootDirectoryNotFound`
|
|
87
|
+
* }
|
|
88
|
+
* // `Root` <- `undefined`
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
export declare function GetPackageRootDirectory(Path?: string): EGetPackageRootDirectory;
|
|
92
|
+
//# sourceMappingURL=Npm.Effect.d.mts.map
|