@percepta/utils 0.1.7 → 0.1.8
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/cjs/config/getEnvConfig.d.ts +26 -26
- package/dist/cjs/config/getEnvConfig.d.ts.map +1 -1
- package/dist/cjs/config/getEnvConfig.js +5 -1
- package/dist/cjs/config/getEnvConfig.js.map +1 -1
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/cjs/utils/index.d.ts +2 -0
- package/dist/cjs/utils/index.d.ts.map +1 -1
- package/dist/cjs/utils/index.js +2 -0
- package/dist/cjs/utils/index.js.map +1 -1
- package/dist/cjs/utils/replaceAt.d.ts +10 -0
- package/dist/cjs/utils/replaceAt.d.ts.map +1 -0
- package/dist/cjs/utils/replaceAt.js +17 -0
- package/dist/cjs/utils/replaceAt.js.map +1 -0
- package/dist/cjs/utils/zodKeyedTypeUnion.d.ts +17 -0
- package/dist/cjs/utils/zodKeyedTypeUnion.d.ts.map +1 -0
- package/dist/cjs/utils/zodKeyedTypeUnion.js +15 -0
- package/dist/cjs/utils/zodKeyedTypeUnion.js.map +1 -0
- package/dist/esnext/config/getEnvConfig.d.ts +26 -26
- package/dist/esnext/config/getEnvConfig.d.ts.map +1 -1
- package/dist/esnext/config/getEnvConfig.js +5 -1
- package/dist/esnext/config/getEnvConfig.js.map +1 -1
- package/dist/esnext/tsconfig.tsbuildinfo +1 -1
- package/dist/esnext/utils/index.d.ts +2 -0
- package/dist/esnext/utils/index.d.ts.map +1 -1
- package/dist/esnext/utils/index.js +2 -0
- package/dist/esnext/utils/index.js.map +1 -1
- package/dist/esnext/utils/replaceAt.d.ts +10 -0
- package/dist/esnext/utils/replaceAt.d.ts.map +1 -0
- package/dist/esnext/utils/replaceAt.js +14 -0
- package/dist/esnext/utils/replaceAt.js.map +1 -0
- package/dist/esnext/utils/zodKeyedTypeUnion.d.ts +17 -0
- package/dist/esnext/utils/zodKeyedTypeUnion.d.ts.map +1 -0
- package/dist/esnext/utils/zodKeyedTypeUnion.js +12 -0
- package/dist/esnext/utils/zodKeyedTypeUnion.js.map +1 -0
- package/package.json +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC"}
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -17,4 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./assertNever"), exports);
|
|
18
18
|
__exportStar(require("./logNever"), exports);
|
|
19
19
|
__exportStar(require("./promiseAllValues"), exports);
|
|
20
|
+
__exportStar(require("./replaceAt"), exports);
|
|
21
|
+
__exportStar(require("./zodKeyedTypeUnion"), exports);
|
|
20
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,6CAA2B;AAC3B,qDAAmC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,6CAA2B;AAC3B,qDAAmC;AACnC,8CAA4B;AAC5B,sDAAoC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a new array with the element at the specified index replaced.
|
|
3
|
+
*
|
|
4
|
+
* @param array The source array
|
|
5
|
+
* @param index The index of the element to replace
|
|
6
|
+
* @param value The new value to insert at the index
|
|
7
|
+
* @returns A new array with the replacement applied
|
|
8
|
+
*/
|
|
9
|
+
export declare function replaceAt<T>(array: T[], index: number, value: T): T[];
|
|
10
|
+
//# sourceMappingURL=replaceAt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replaceAt.d.ts","sourceRoot":"","sources":["../../../src/utils/replaceAt.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,CAIrE"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.replaceAt = replaceAt;
|
|
4
|
+
/**
|
|
5
|
+
* Returns a new array with the element at the specified index replaced.
|
|
6
|
+
*
|
|
7
|
+
* @param array The source array
|
|
8
|
+
* @param index The index of the element to replace
|
|
9
|
+
* @param value The new value to insert at the index
|
|
10
|
+
* @returns A new array with the replacement applied
|
|
11
|
+
*/
|
|
12
|
+
function replaceAt(array, index, value) {
|
|
13
|
+
const newArray = [...array];
|
|
14
|
+
newArray[index] = value;
|
|
15
|
+
return newArray;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=replaceAt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replaceAt.js","sourceRoot":"","sources":["../../../src/utils/replaceAt.ts"],"names":[],"mappings":";;AAQA,8BAIC;AAZD;;;;;;;GAOG;AACH,SAAgB,SAAS,CAAI,KAAU,EAAE,KAAa,EAAE,KAAQ;IAC9D,MAAM,QAAQ,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC;IAC5B,QAAQ,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;IACxB,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type KeyedTypeUnion, type ValueForTypeKey } from "keyed-type-union";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
type SchemasByType<TTypeUnion extends KeyedTypeUnion<Record<string, unknown>, TTypeKey>, TTypeKey extends string = "type"> = {
|
|
4
|
+
[TType in TTypeUnion[TTypeKey]]: z.ZodType<ValueForTypeKey<TTypeUnion, TType, TTypeKey>>;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Creates a Zod schema for a discriminated union of type-union types.
|
|
8
|
+
* We can use this util alongside keyed-type-union for stricter type union patterns.
|
|
9
|
+
*
|
|
10
|
+
* @param schemasByType A record of type keys to their corresponding Zod schemas.
|
|
11
|
+
* @param typeKey The optional key used to discriminate between the different types in the union.
|
|
12
|
+
* @returns A Zod schema for the discriminated union.
|
|
13
|
+
*/
|
|
14
|
+
export declare function zodKeyedTypeUnion<TTypeUnion extends KeyedTypeUnion<Record<string, unknown>>>(schemasByType: SchemasByType<TTypeUnion>): z.ZodType<TTypeUnion>;
|
|
15
|
+
export declare function zodKeyedTypeUnion<TTypeUnion extends KeyedTypeUnion<Record<string, unknown>, TTypeKey>, TTypeKey extends string>(schemasByType: SchemasByType<TTypeUnion, TTypeKey>, typeKey: TTypeKey): z.ZodType<TTypeUnion>;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=zodKeyedTypeUnion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zodKeyedTypeUnion.d.ts","sourceRoot":"","sources":["../../../src/utils/zodKeyedTypeUnion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,KAAK,aAAa,CAChB,UAAU,SAAS,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,CAAC,EACpE,QAAQ,SAAS,MAAM,GAAG,MAAM,IAC9B;KACD,KAAK,IAAI,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,CACxC,eAAe,CAAC,UAAU,EAAE,KAAK,EAAE,QAAQ,CAAC,CAC7C;CACF,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,SAAS,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAC1D,aAAa,EAAE,aAAa,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;AACnE,wBAAgB,iBAAiB,CAC/B,UAAU,SAAS,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,CAAC,EACpE,QAAQ,SAAS,MAAM,EAEvB,aAAa,EAAE,aAAa,CAAC,UAAU,EAAE,QAAQ,CAAC,EAClD,OAAO,EAAE,QAAQ,GAChB,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.zodKeyedTypeUnion = zodKeyedTypeUnion;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
function zodKeyedTypeUnion(schemasByType, typeKey = "type") {
|
|
6
|
+
/**
|
|
7
|
+
* There are a lot of casts here because of our fancy generics.
|
|
8
|
+
* We won't worry about them for now; we'll just use our tests to ensure runtime safety.
|
|
9
|
+
*/
|
|
10
|
+
return zod_1.z.discriminatedUnion(typeKey, Object.entries(schemasByType).map(([type, schema]) => zod_1.z.object({
|
|
11
|
+
[typeKey]: zod_1.z.literal(type),
|
|
12
|
+
[type]: schema,
|
|
13
|
+
})));
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=zodKeyedTypeUnion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zodKeyedTypeUnion.js","sourceRoot":"","sources":["../../../src/utils/zodKeyedTypeUnion.ts"],"names":[],"mappings":";;AA8BA,8CAoBC;AAjDD,6BAAwB;AA6BxB,SAAgB,iBAAiB,CAI/B,aAAkD,EAClD,UAAoB,MAAe;IAEnC;;;OAGG;IACH,OAAO,OAAC,CAAC,kBAAkB,CACzB,OAAO,EACP,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,EAAE,CACnD,OAAC,CAAC,MAAM,CAAC;QACP,CAAC,OAAO,CAAC,EAAE,OAAC,CAAC,OAAO,CAAC,IAAI,CAAC;QAC1B,CAAC,IAAI,CAAC,EAAE,MAAe;KACxB,CAAC,CACM,CACF,CAAC;AACb,CAAC"}
|
|
@@ -5,12 +5,12 @@ export declare const BASE_ENV_SCHEMA: z.ZodObject<{
|
|
|
5
5
|
production: "production";
|
|
6
6
|
test: "test";
|
|
7
7
|
}>>;
|
|
8
|
-
LOG_LEVEL: z.ZodDefault<z.ZodEnum<{
|
|
8
|
+
LOG_LEVEL: z.ZodDefault<z.ZodPipe<z.ZodString, z.ZodEnum<{
|
|
9
9
|
debug: "debug";
|
|
10
10
|
info: "info";
|
|
11
11
|
warn: "warn";
|
|
12
12
|
error: "error";
|
|
13
|
-
}
|
|
13
|
+
}>>>;
|
|
14
14
|
}, z.core.$strip>;
|
|
15
15
|
export type BaseEnvConfig = z.infer<typeof BASE_ENV_SCHEMA>;
|
|
16
16
|
export declare function createEnvConfig<TExtension extends z.ZodRawShape>(extensionSchema: z.ZodObject<TExtension>): {
|
|
@@ -20,72 +20,72 @@ export declare function createEnvConfig<TExtension extends z.ZodRawShape>(extens
|
|
|
20
20
|
production: "production";
|
|
21
21
|
test: "test";
|
|
22
22
|
}>>;
|
|
23
|
-
LOG_LEVEL: z.ZodDefault<z.ZodEnum<{
|
|
23
|
+
LOG_LEVEL: z.ZodDefault<z.ZodPipe<z.ZodString, z.ZodEnum<{
|
|
24
24
|
debug: "debug";
|
|
25
25
|
info: "info";
|
|
26
26
|
warn: "warn";
|
|
27
27
|
error: "error";
|
|
28
|
-
}
|
|
28
|
+
}>>>;
|
|
29
29
|
} & TExtension : ({
|
|
30
30
|
NODE_ENV: z.ZodDefault<z.ZodEnum<{
|
|
31
31
|
development: "development";
|
|
32
32
|
production: "production";
|
|
33
33
|
test: "test";
|
|
34
34
|
}>>;
|
|
35
|
-
LOG_LEVEL: z.ZodDefault<z.ZodEnum<{
|
|
35
|
+
LOG_LEVEL: z.ZodDefault<z.ZodPipe<z.ZodString, z.ZodEnum<{
|
|
36
36
|
debug: "debug";
|
|
37
37
|
info: "info";
|
|
38
38
|
warn: "warn";
|
|
39
39
|
error: "error";
|
|
40
|
-
}
|
|
40
|
+
}>>>;
|
|
41
41
|
} extends infer T_2 extends z.core.util.SomeObject ? { [K in keyof T_2 as K extends keyof TExtension ? never : K]: {
|
|
42
42
|
NODE_ENV: z.ZodDefault<z.ZodEnum<{
|
|
43
43
|
development: "development";
|
|
44
44
|
production: "production";
|
|
45
45
|
test: "test";
|
|
46
46
|
}>>;
|
|
47
|
-
LOG_LEVEL: z.ZodDefault<z.ZodEnum<{
|
|
47
|
+
LOG_LEVEL: z.ZodDefault<z.ZodPipe<z.ZodString, z.ZodEnum<{
|
|
48
48
|
debug: "debug";
|
|
49
49
|
info: "info";
|
|
50
50
|
warn: "warn";
|
|
51
51
|
error: "error";
|
|
52
|
-
}
|
|
52
|
+
}>>>;
|
|
53
53
|
}[K]; } : never) & { [K_1 in keyof TExtension]: TExtension[K_1]; }) extends infer T ? { [k in keyof T]: (("NODE_ENV" | "LOG_LEVEL") & keyof TExtension extends never ? {
|
|
54
54
|
NODE_ENV: z.ZodDefault<z.ZodEnum<{
|
|
55
55
|
development: "development";
|
|
56
56
|
production: "production";
|
|
57
57
|
test: "test";
|
|
58
58
|
}>>;
|
|
59
|
-
LOG_LEVEL: z.ZodDefault<z.ZodEnum<{
|
|
59
|
+
LOG_LEVEL: z.ZodDefault<z.ZodPipe<z.ZodString, z.ZodEnum<{
|
|
60
60
|
debug: "debug";
|
|
61
61
|
info: "info";
|
|
62
62
|
warn: "warn";
|
|
63
63
|
error: "error";
|
|
64
|
-
}
|
|
64
|
+
}>>>;
|
|
65
65
|
} & TExtension : ({
|
|
66
66
|
NODE_ENV: z.ZodDefault<z.ZodEnum<{
|
|
67
67
|
development: "development";
|
|
68
68
|
production: "production";
|
|
69
69
|
test: "test";
|
|
70
70
|
}>>;
|
|
71
|
-
LOG_LEVEL: z.ZodDefault<z.ZodEnum<{
|
|
71
|
+
LOG_LEVEL: z.ZodDefault<z.ZodPipe<z.ZodString, z.ZodEnum<{
|
|
72
72
|
debug: "debug";
|
|
73
73
|
info: "info";
|
|
74
74
|
warn: "warn";
|
|
75
75
|
error: "error";
|
|
76
|
-
}
|
|
76
|
+
}>>>;
|
|
77
77
|
} extends infer T_1 extends z.core.util.SomeObject ? { [K in keyof T_1 as K extends keyof TExtension ? never : K]: {
|
|
78
78
|
NODE_ENV: z.ZodDefault<z.ZodEnum<{
|
|
79
79
|
development: "development";
|
|
80
80
|
production: "production";
|
|
81
81
|
test: "test";
|
|
82
82
|
}>>;
|
|
83
|
-
LOG_LEVEL: z.ZodDefault<z.ZodEnum<{
|
|
83
|
+
LOG_LEVEL: z.ZodDefault<z.ZodPipe<z.ZodString, z.ZodEnum<{
|
|
84
84
|
debug: "debug";
|
|
85
85
|
info: "info";
|
|
86
86
|
warn: "warn";
|
|
87
87
|
error: "error";
|
|
88
|
-
}
|
|
88
|
+
}>>>;
|
|
89
89
|
}[K]; } : never) & { [K_1 in keyof TExtension]: TExtension[K_1]; })[k]; } : never, {}>;
|
|
90
90
|
schema: z.ZodObject<(("NODE_ENV" | "LOG_LEVEL") & keyof TExtension extends never ? {
|
|
91
91
|
NODE_ENV: z.ZodDefault<z.ZodEnum<{
|
|
@@ -93,72 +93,72 @@ export declare function createEnvConfig<TExtension extends z.ZodRawShape>(extens
|
|
|
93
93
|
production: "production";
|
|
94
94
|
test: "test";
|
|
95
95
|
}>>;
|
|
96
|
-
LOG_LEVEL: z.ZodDefault<z.ZodEnum<{
|
|
96
|
+
LOG_LEVEL: z.ZodDefault<z.ZodPipe<z.ZodString, z.ZodEnum<{
|
|
97
97
|
debug: "debug";
|
|
98
98
|
info: "info";
|
|
99
99
|
warn: "warn";
|
|
100
100
|
error: "error";
|
|
101
|
-
}
|
|
101
|
+
}>>>;
|
|
102
102
|
} & TExtension : ({
|
|
103
103
|
NODE_ENV: z.ZodDefault<z.ZodEnum<{
|
|
104
104
|
development: "development";
|
|
105
105
|
production: "production";
|
|
106
106
|
test: "test";
|
|
107
107
|
}>>;
|
|
108
|
-
LOG_LEVEL: z.ZodDefault<z.ZodEnum<{
|
|
108
|
+
LOG_LEVEL: z.ZodDefault<z.ZodPipe<z.ZodString, z.ZodEnum<{
|
|
109
109
|
debug: "debug";
|
|
110
110
|
info: "info";
|
|
111
111
|
warn: "warn";
|
|
112
112
|
error: "error";
|
|
113
|
-
}
|
|
113
|
+
}>>>;
|
|
114
114
|
} extends infer T_2 extends z.core.util.SomeObject ? { [K in keyof T_2 as K extends keyof TExtension ? never : K]: {
|
|
115
115
|
NODE_ENV: z.ZodDefault<z.ZodEnum<{
|
|
116
116
|
development: "development";
|
|
117
117
|
production: "production";
|
|
118
118
|
test: "test";
|
|
119
119
|
}>>;
|
|
120
|
-
LOG_LEVEL: z.ZodDefault<z.ZodEnum<{
|
|
120
|
+
LOG_LEVEL: z.ZodDefault<z.ZodPipe<z.ZodString, z.ZodEnum<{
|
|
121
121
|
debug: "debug";
|
|
122
122
|
info: "info";
|
|
123
123
|
warn: "warn";
|
|
124
124
|
error: "error";
|
|
125
|
-
}
|
|
125
|
+
}>>>;
|
|
126
126
|
}[K]; } : never) & { [K_1 in keyof TExtension]: TExtension[K_1]; }) extends infer T ? { [k in keyof T]: (("NODE_ENV" | "LOG_LEVEL") & keyof TExtension extends never ? {
|
|
127
127
|
NODE_ENV: z.ZodDefault<z.ZodEnum<{
|
|
128
128
|
development: "development";
|
|
129
129
|
production: "production";
|
|
130
130
|
test: "test";
|
|
131
131
|
}>>;
|
|
132
|
-
LOG_LEVEL: z.ZodDefault<z.ZodEnum<{
|
|
132
|
+
LOG_LEVEL: z.ZodDefault<z.ZodPipe<z.ZodString, z.ZodEnum<{
|
|
133
133
|
debug: "debug";
|
|
134
134
|
info: "info";
|
|
135
135
|
warn: "warn";
|
|
136
136
|
error: "error";
|
|
137
|
-
}
|
|
137
|
+
}>>>;
|
|
138
138
|
} & TExtension : ({
|
|
139
139
|
NODE_ENV: z.ZodDefault<z.ZodEnum<{
|
|
140
140
|
development: "development";
|
|
141
141
|
production: "production";
|
|
142
142
|
test: "test";
|
|
143
143
|
}>>;
|
|
144
|
-
LOG_LEVEL: z.ZodDefault<z.ZodEnum<{
|
|
144
|
+
LOG_LEVEL: z.ZodDefault<z.ZodPipe<z.ZodString, z.ZodEnum<{
|
|
145
145
|
debug: "debug";
|
|
146
146
|
info: "info";
|
|
147
147
|
warn: "warn";
|
|
148
148
|
error: "error";
|
|
149
|
-
}
|
|
149
|
+
}>>>;
|
|
150
150
|
} extends infer T_1 extends z.core.util.SomeObject ? { [K in keyof T_1 as K extends keyof TExtension ? never : K]: {
|
|
151
151
|
NODE_ENV: z.ZodDefault<z.ZodEnum<{
|
|
152
152
|
development: "development";
|
|
153
153
|
production: "production";
|
|
154
154
|
test: "test";
|
|
155
155
|
}>>;
|
|
156
|
-
LOG_LEVEL: z.ZodDefault<z.ZodEnum<{
|
|
156
|
+
LOG_LEVEL: z.ZodDefault<z.ZodPipe<z.ZodString, z.ZodEnum<{
|
|
157
157
|
debug: "debug";
|
|
158
158
|
info: "info";
|
|
159
159
|
warn: "warn";
|
|
160
160
|
error: "error";
|
|
161
|
-
}
|
|
161
|
+
}>>>;
|
|
162
162
|
}[K]; } : never) & { [K_1 in keyof TExtension]: TExtension[K_1]; })[k]; } : never, z.core.$strip>;
|
|
163
163
|
};
|
|
164
164
|
//# sourceMappingURL=getEnvConfig.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getEnvConfig.d.ts","sourceRoot":"","sources":["../../../src/config/getEnvConfig.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,eAAe;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"getEnvConfig.d.ts","sourceRoot":"","sources":["../../../src/config/getEnvConfig.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,eAAe;;;;;;;;;;;;iBAS1B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAG5D,wBAAgB,eAAe,CAAC,UAAU,SAAS,CAAC,CAAC,WAAW,EAC9D,eAAe,EAAE,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAezC"}
|
|
@@ -5,7 +5,11 @@ export const BASE_ENV_SCHEMA = z.object({
|
|
|
5
5
|
NODE_ENV: z
|
|
6
6
|
.enum(["development", "production", "test"])
|
|
7
7
|
.default("development"),
|
|
8
|
-
LOG_LEVEL: z
|
|
8
|
+
LOG_LEVEL: z
|
|
9
|
+
.string()
|
|
10
|
+
.toLowerCase()
|
|
11
|
+
.pipe(z.enum(["debug", "info", "warn", "error"]))
|
|
12
|
+
.default("info"),
|
|
9
13
|
});
|
|
10
14
|
// Factory that creates a configured getEnvConfig
|
|
11
15
|
export function createEnvConfig(extensionSchema) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getEnvConfig.js","sourceRoot":"","sources":["../../../src/config/getEnvConfig.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,gCAAgC;AAChC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,QAAQ,EAAE,CAAC;SACR,IAAI,CAAC,CAAC,aAAa,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;SAC3C,OAAO,CAAC,aAAa,CAAC;IACzB,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"getEnvConfig.js","sourceRoot":"","sources":["../../../src/config/getEnvConfig.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,gCAAgC;AAChC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,QAAQ,EAAE,CAAC;SACR,IAAI,CAAC,CAAC,aAAa,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;SAC3C,OAAO,CAAC,aAAa,CAAC;IACzB,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,WAAW,EAAE;SACb,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;SAChD,OAAO,CAAC,MAAM,CAAC;CACnB,CAAC,CAAC;AAIH,iDAAiD;AACjD,MAAM,UAAU,eAAe,CAC7B,eAAwC;IAExC,MAAM,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAG7D,IAAI,OAA2B,CAAC;IAEhC,SAAS,YAAY;QACnB,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;YACpB,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACtC,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC;AAClC,CAAC"}
|