@theholocron/env-utils 1.6.0 → 1.7.1
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/dist/index.d.mts +10 -10
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -20,7 +20,7 @@ interface EnvLookup {
|
|
|
20
20
|
* return createEnvLookup(source);
|
|
21
21
|
* }
|
|
22
22
|
*/
|
|
23
|
-
declare function createEnvLookup(source?: Record<string, string | undefined>): EnvLookup;
|
|
23
|
+
export declare function createEnvLookup(source?: Record<string, string | undefined>): EnvLookup;
|
|
24
24
|
//#endregion
|
|
25
25
|
//#region src/types.d.ts
|
|
26
26
|
type Primitive = string | number | boolean;
|
|
@@ -157,12 +157,12 @@ interface EnvParser<T extends EnvObject = EnvObject> {
|
|
|
157
157
|
* auth: get("auth0"), // returns the whole auth0 namespace object
|
|
158
158
|
* }));
|
|
159
159
|
*/
|
|
160
|
-
declare function createEnvParser<T extends EnvObject = EnvObject>(options: EnvParserOptions): EnvParser<T>;
|
|
160
|
+
export declare function createEnvParser<T extends EnvObject = EnvObject>(options: EnvParserOptions): EnvParser<T>;
|
|
161
161
|
//#endregion
|
|
162
162
|
//#region src/environment.d.ts
|
|
163
|
-
declare const ENVIRONMENTS: readonly ["local", "dev", "qa", "prod"];
|
|
164
|
-
declare const DEFAULT_ENVIRONMENT: Environment;
|
|
165
|
-
declare const DEPLOYED_ENVIRONMENTS: Set<"local" | "dev" | "qa" | "prod">;
|
|
163
|
+
export declare const ENVIRONMENTS: readonly ["local", "dev", "qa", "prod"];
|
|
164
|
+
export declare const DEFAULT_ENVIRONMENT: Environment;
|
|
165
|
+
export declare const DEPLOYED_ENVIRONMENTS: Set<"local" | "dev" | "qa" | "prod">;
|
|
166
166
|
/**
|
|
167
167
|
* Normalize a string into a canonical Environment.
|
|
168
168
|
* Returns undefined if the value is not recognized.
|
|
@@ -172,7 +172,7 @@ declare function normalizeEnvironment(value: string): Environment | undefined;
|
|
|
172
172
|
* Resolve the current environment from input or process.env.
|
|
173
173
|
*/
|
|
174
174
|
declare function getEnvironment(): Environment;
|
|
175
|
-
declare const environment: {
|
|
175
|
+
export declare const environment: {
|
|
176
176
|
get: typeof getEnvironment;
|
|
177
177
|
normalize: typeof normalizeEnvironment;
|
|
178
178
|
isDeployed: () => boolean;
|
|
@@ -187,7 +187,7 @@ type Environment = (typeof ENVIRONMENTS)[number];
|
|
|
187
187
|
* Swap this out via `createEnvParser({ loader: new MyLoader() })`
|
|
188
188
|
* if you ever need Vault, AWS SSM, dotenvx, etc.
|
|
189
189
|
*/
|
|
190
|
-
declare class DotenvLoader implements EnvLoader {
|
|
190
|
+
export declare class DotenvLoader implements EnvLoader {
|
|
191
191
|
load(): Record<string, string | undefined>;
|
|
192
192
|
}
|
|
193
193
|
//#endregion
|
|
@@ -203,7 +203,7 @@ declare class DotenvLoader implements EnvLoader {
|
|
|
203
203
|
* filterByNamespace({ HOLOCRON_DEBUG: "true", PORT: "3000" }, "HOLOCRON")
|
|
204
204
|
* // → { DEBUG: "true" }
|
|
205
205
|
*/
|
|
206
|
-
declare function filterByNamespace(raw: Record<string, string | undefined>, namespace: string): Record<string, string | undefined>;
|
|
206
|
+
export declare function filterByNamespace(raw: Record<string, string | undefined>, namespace: string): Record<string, string | undefined>;
|
|
207
207
|
/**
|
|
208
208
|
* Merge multiple namespace-filtered views of a raw env record.
|
|
209
209
|
*
|
|
@@ -216,6 +216,6 @@ declare function filterByNamespace(raw: Record<string, string | undefined>, name
|
|
|
216
216
|
* // HOLOCRON_DEBUG is the org-wide default; CLI_TEMPLATE_DEBUG overrides it.
|
|
217
217
|
* mergeNamespaces(raw, ["HOLOCRON", "CLI_TEMPLATE"])
|
|
218
218
|
*/
|
|
219
|
-
declare function mergeNamespaces(raw: Record<string, string | undefined>, namespaces: string[]): Record<string, string | undefined>;
|
|
219
|
+
export declare function mergeNamespaces(raw: Record<string, string | undefined>, namespaces: string[]): Record<string, string | undefined>;
|
|
220
220
|
//#endregion
|
|
221
|
-
export {
|
|
221
|
+
export type { EnvLoader, EnvLookup, EnvObject, EnvParser, EnvParserOptions, Environment, Primitive };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theholocron/env-utils",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.1",
|
|
4
4
|
"description": "Runtime environment detection and typed env-var parsing.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"env",
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
"dist"
|
|
31
31
|
],
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@theholocron/tsdown-config": "^7.
|
|
34
|
-
"@theholocron/vitest-config": "^7.
|
|
33
|
+
"@theholocron/tsdown-config": "^7.33.0",
|
|
34
|
+
"@theholocron/vitest-config": "^7.33.0",
|
|
35
35
|
"@tsconfig/node-lts": "^24.0.1",
|
|
36
36
|
"@types/node": "^26.2.0",
|
|
37
37
|
"@vitest/coverage-v8": "^4.1.10",
|
|
38
38
|
"dotenv": "^17.4.2",
|
|
39
|
-
"tsdown": "^0.
|
|
39
|
+
"tsdown": "^0.23.0",
|
|
40
40
|
"vitest": "^4.1.10"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|