@e-n-v/env 0.0.7 → 0.0.9
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/{BooleanMap-B7MeMkJC.d.ts → BooleanMap-BPQuO3Ae.d.ts} +1 -3
- package/dist/{BooleanMap-D93UJnv5.d.cts → BooleanMap-CX_YrPCf.d.cts} +1 -3
- package/dist/EnvChannelOptions-BbKeuO-o.d.cts +366 -0
- package/dist/EnvChannelOptions-BbKeuO-o.d.ts +366 -0
- package/dist/{EnvSource-DA3ZGlES.js → EnvSource-WAGWqRVM.js} +6 -10
- package/dist/{EnvSource-BVnmdHku.cjs → EnvSource-s8F_M_6O.cjs} +21 -28
- package/dist/EnvVarSchema-CDZGmnex.cjs +15 -0
- package/dist/EnvVarSchema-Dr6q7jf6.js +10 -0
- package/dist/{ProcessEnvChannel-Do4-yiLI.d.ts → ProcessEnvChannel-CwhV7_EB.d.ts} +2 -4
- package/dist/{ProcessEnvChannel-D465c-dp.d.cts → ProcessEnvChannel-DWHPZePe.d.cts} +2 -4
- package/dist/channels.cjs +3 -4
- package/dist/channels.d.cts +3 -4
- package/dist/channels.d.ts +3 -4
- package/dist/channels.js +2 -4
- package/dist/cli.cjs +10 -23
- package/dist/cli.d.cts +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +7 -13
- package/dist/core.cjs +13 -14
- package/dist/core.d.cts +147 -6
- package/dist/core.d.ts +147 -6
- package/dist/core.js +9 -11
- package/dist/{custom-Bt_wnxIu.js → custom-Bd-jLg80.js} +3 -12
- package/dist/{custom-D_Rqjm09.cjs → custom-Dyb9TnER.cjs} +48 -58
- package/dist/files.cjs +6 -6
- package/dist/files.d.cts +2 -2
- package/dist/files.d.ts +2 -2
- package/dist/files.js +2 -5
- package/dist/{parse-awxwtQ1N.d.ts → index-B2eNij2x.d.cts} +1 -2
- package/dist/{parse-5fpTbjTr.d.cts → index-BHTM8nxS.d.ts} +1 -2
- package/dist/{prompt-DG8haZjn.d.ts → index-BKBW9Dxs.d.cts} +3 -4
- package/dist/{prompt-lmZdPaBh.d.cts → index-CEyOIRdj.d.ts} +3 -4
- package/dist/{EnvModel-BiT0OiDZ.d.ts → index-Cb0abjLf.d.ts} +59 -7
- package/dist/{EnvModel-I0fWZZ_n.d.cts → index-Cz3frUwZ.d.cts} +58 -6
- package/dist/index.cjs +27 -30
- package/dist/index.d.cts +11 -13
- package/dist/index.d.ts +11 -13
- package/dist/index.js +8 -14
- package/dist/model.cjs +10 -11
- package/dist/model.d.cts +2 -35
- package/dist/model.d.ts +2 -35
- package/dist/model.js +2 -6
- package/dist/parse.cjs +14 -14
- package/dist/parse.d.cts +5 -8
- package/dist/parse.d.ts +5 -8
- package/dist/parse.js +4 -7
- package/dist/preprocessors-BKuIcZa1.d.ts +83 -0
- package/dist/preprocessors-DFVyF0c7.d.cts +83 -0
- package/dist/prompt.cjs +12 -15
- package/dist/prompt.d.cts +5 -10
- package/dist/prompt.d.ts +5 -10
- package/dist/prompt.js +3 -9
- package/dist/{redis-Cazgs3_J.cjs → redis-CyTF0SYT.cjs} +260 -268
- package/dist/{redis-DXhlNtvD.js → redis-D18f4ztf.js} +15 -22
- package/dist/{index-UQm0jdkG.d.cts → redis-DsW-Vkwq.d.cts} +2 -6
- package/dist/{index-ClKndmJv.d.ts → redis-tRD4nAy_.d.ts} +2 -6
- package/dist/{resolveChannel-v9BDsw-M.js → resolveChannel-D1Fzl4TL.js} +59 -63
- package/dist/{resolveChannel-CjAuxy3p.cjs → resolveChannel-DxZNYdDe.cjs} +84 -92
- package/dist/{chunk-pbleEpgJ.cjs → rolldown-runtime-C0BPl7ul.cjs} +15 -16
- package/dist/{chunk-Bp6m_JJh.js → rolldown-runtime-D7D4PA-g.js} +4 -4
- package/dist/{schema-DdDa3Qjy.d.cts → schema-B-JLVS42.d.ts} +1 -3
- package/dist/{schema-CHypJTDK.d.ts → schema-B1i83alz.d.cts} +1 -3
- package/dist/schema-CtP5lpU1.js +11 -0
- package/dist/schema-D9nJKipf.cjs +22 -0
- package/dist/schemas/zod.cjs +42 -340
- package/dist/schemas/zod.d.cts +112 -114
- package/dist/schemas/zod.d.ts +112 -114
- package/dist/schemas/zod.js +111 -401
- package/dist/schemas.cjs +152 -155
- package/dist/schemas.d.cts +1 -2
- package/dist/schemas.d.ts +1 -2
- package/dist/schemas.js +2 -6
- package/dist/{src-CdqOYilA.cjs → src-5GYFbR9n.cjs} +21 -24
- package/dist/{src-BrNrE0hX.js → src-8rEOvFG5.js} +11 -14
- package/dist/{src-DI-VW4dW.js → src-CdzAzdq-.js} +77 -110
- package/dist/{src-B5Qu-M-r.js → src-Cg49gGJb.js} +9 -43
- package/dist/{src-dO72HN6e.cjs → src-CttkcdpE.cjs} +90 -130
- package/dist/{src-PHSSk-t3.cjs → src-D5KzIEH_.cjs} +130 -110
- package/dist/{src-DVdOONrX.cjs → src-DB0Har0j.cjs} +911 -932
- package/dist/{src-DQaQ28lz.js → src-DWc-WWjX.js} +107 -89
- package/dist/{src-vBXlFkSP.js → src-DvUBRBe3.js} +115 -136
- package/dist/{src-DywfI0fM.cjs → src-TZx_e95f.cjs} +78 -131
- package/dist/{vars-DF9DoAF4.d.ts → vars-DtzGL5Nc.d.cts} +1 -4
- package/dist/{vars-KUgv2rti.d.cts → vars-obKYxaSu.d.ts} +1 -4
- package/dist/vars.cjs +175 -160
- package/dist/vars.d.cts +2 -6
- package/dist/vars.d.ts +2 -6
- package/dist/vars.js +21 -9
- package/package.json +3 -2
- package/dist/EnvChannelOptions-BPkWDrmr.d.cts +0 -108
- package/dist/EnvChannelOptions-CRwDLWjd.d.ts +0 -108
- package/dist/coerce-DNIuYAx4.js +0 -11028
- package/dist/coerce-b7UVodS9.cjs +0 -12365
- package/dist/model-BNDYMM9l.d.ts +0 -29
- package/dist/model-CJMnbGuS.d.cts +0 -29
- package/dist/validate-8HbVniNt.d.cts +0 -204
- package/dist/validate-CE8hQ5JG.d.ts +0 -204
- package/dist/vars-BHXXBiY1.cjs +0 -27
- package/dist/vars-FOuH_HuL.js +0 -22
- /package/dist/{EnvChannel-LMIRYvT1.d.cts → EnvChannel-CfSwa_25.d.cts} +0 -0
- /package/dist/{EnvChannel-w27PEm7x.d.ts → EnvChannel-CfSwa_25.d.ts} +0 -0
- /package/dist/{StringEnvVarSchema-BwSGgmeG.d.ts → StringEnvVarSchema-D9Jr1Aws.d.cts} +0 -0
- /package/dist/{StringEnvVarSchema-DnsZTIS0.d.cts → StringEnvVarSchema-D9Jr1Aws.d.ts} +0 -0
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
|
|
1
|
+
const require_rolldown_runtime = require("./rolldown-runtime-C0BPl7ul.cjs");
|
|
2
|
+
const require_src = require("./src-TZx_e95f.cjs");
|
|
3
|
+
const require_EnvVarSchema = require("./EnvVarSchema-CDZGmnex.cjs");
|
|
4
|
+
let zod = require("zod");
|
|
5
|
+
let zod_v4_core = require("zod/v4/core");
|
|
6
|
+
zod_v4_core = require_rolldown_runtime.__toESM(zod_v4_core, 1);
|
|
4
7
|
//#region ../converters/src/converters/zod/ZodV3Converter.ts
|
|
5
8
|
/**
|
|
6
9
|
* Zod v3 schema converter implementation
|
|
@@ -119,11 +122,10 @@ function peelV3Schema(schema) {
|
|
|
119
122
|
*/
|
|
120
123
|
function createV3ProcessFunction(schema, type) {
|
|
121
124
|
return (value) => {
|
|
122
|
-
if (typeof value !== "string") throw new Error("Value must be a string");
|
|
123
125
|
try {
|
|
124
126
|
let processSchema = schema;
|
|
125
|
-
if (type === "number") processSchema =
|
|
126
|
-
else if (type === "boolean") processSchema =
|
|
127
|
+
if (typeof value === "string" && type === "number") processSchema = zod.z.coerce.number();
|
|
128
|
+
else if (typeof value === "string" && type === "boolean") processSchema = zod.z.string().transform((val) => {
|
|
127
129
|
const lower = val.toLowerCase().trim();
|
|
128
130
|
if ([
|
|
129
131
|
"true",
|
|
@@ -158,29 +160,35 @@ function convertFromZodV3Schema(schema) {
|
|
|
158
160
|
const type = resolveV3EnvVarType(peeled.schema);
|
|
159
161
|
const def = getV3Def(peeled.schema);
|
|
160
162
|
switch (type) {
|
|
161
|
-
case "boolean":
|
|
162
|
-
process
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
163
|
+
case "boolean": {
|
|
164
|
+
const process = createV3ProcessFunction(peeled.schema, "boolean");
|
|
165
|
+
return new require_src.BooleanEnvVarSchema({
|
|
166
|
+
process,
|
|
167
|
+
required: peeled.required,
|
|
168
|
+
default: typeof peeled.default === "boolean" ? peeled.default : void 0,
|
|
169
|
+
description: peeled.description
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
case "number": {
|
|
173
|
+
const process = createV3ProcessFunction(peeled.schema, "number");
|
|
174
|
+
return new require_src.NumberEnvVarSchema({
|
|
175
|
+
process,
|
|
176
|
+
required: peeled.required,
|
|
177
|
+
default: typeof peeled.default === "number" ? peeled.default : void 0,
|
|
178
|
+
description: peeled.description
|
|
179
|
+
});
|
|
180
|
+
}
|
|
173
181
|
case "enum": {
|
|
174
182
|
const values = extractV3EnumValues(def) || [];
|
|
183
|
+
const process = createV3ProcessFunction(peeled.schema, "enum");
|
|
175
184
|
return new require_src.EnumEnvVarSchema({
|
|
176
|
-
process
|
|
185
|
+
process,
|
|
177
186
|
values,
|
|
178
187
|
required: peeled.required,
|
|
179
188
|
default: typeof peeled.default === "string" ? peeled.default : void 0,
|
|
180
189
|
description: peeled.description
|
|
181
190
|
});
|
|
182
191
|
}
|
|
183
|
-
case "string":
|
|
184
192
|
default: {
|
|
185
193
|
const process = createV3ProcessFunction(peeled.schema, "string");
|
|
186
194
|
const defaultValue = typeof peeled.default === "string" ? peeled.default : void 0;
|
|
@@ -193,7 +201,6 @@ function convertFromZodV3Schema(schema) {
|
|
|
193
201
|
}
|
|
194
202
|
}
|
|
195
203
|
}
|
|
196
|
-
|
|
197
204
|
//#endregion
|
|
198
205
|
//#region ../converters/src/converters/zod/ZodV4Converter.ts
|
|
199
206
|
/**
|
|
@@ -332,15 +339,14 @@ function peelV4Schema(schema) {
|
|
|
332
339
|
*/
|
|
333
340
|
function createV4ProcessFunction(schema, type, originalSchema) {
|
|
334
341
|
return (value) => {
|
|
335
|
-
if (typeof value !== "string") throw new Error("Value must be a string");
|
|
336
342
|
try {
|
|
337
343
|
let processSchema = schema;
|
|
338
344
|
const def = getV4Def(schema);
|
|
339
345
|
const typeName = getV4TypeName(def);
|
|
340
|
-
if (typeName === "stringbool" || typeName === "pipe" && def.in && def.out && resolveV4EnvVarType(def.in) === "string" && resolveV4EnvVarType(def.out) === "boolean") processSchema = originalSchema;
|
|
341
|
-
else if (type === "number") processSchema =
|
|
342
|
-
else if (type === "boolean") processSchema =
|
|
343
|
-
const result =
|
|
346
|
+
if (typeof value === "string" && typeName === "stringbool" || typeof value === "string" && typeName === "pipe" && def.in && def.out && resolveV4EnvVarType(def.in) === "string" && resolveV4EnvVarType(def.out) === "boolean") processSchema = originalSchema;
|
|
347
|
+
else if (typeof value === "string" && type === "number") processSchema = zod.z.coerce.number();
|
|
348
|
+
else if (typeof value === "string" && type === "boolean") processSchema = zod.z.stringbool();
|
|
349
|
+
const result = zod_v4_core.safeParse(processSchema, value);
|
|
344
350
|
if (result.success) return result.data;
|
|
345
351
|
throw new Error(`Failed to parse value "${value}": ${result.error.issues.map((issue) => issue.message).join("; ")}`);
|
|
346
352
|
} catch (error) {
|
|
@@ -357,29 +363,35 @@ function convertFromZodV4Schema(schema) {
|
|
|
357
363
|
const type = resolveV4EnvVarType(peeled.schema);
|
|
358
364
|
const def = getV4Def(peeled.schema);
|
|
359
365
|
switch (type) {
|
|
360
|
-
case "boolean":
|
|
361
|
-
process
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
366
|
+
case "boolean": {
|
|
367
|
+
const process = createV4ProcessFunction(peeled.schema, "boolean", schema);
|
|
368
|
+
return new require_src.BooleanEnvVarSchema({
|
|
369
|
+
process,
|
|
370
|
+
required: peeled.required,
|
|
371
|
+
default: typeof peeled.default === "boolean" ? peeled.default : void 0,
|
|
372
|
+
description: peeled.description
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
case "number": {
|
|
376
|
+
const process = createV4ProcessFunction(peeled.schema, "number", schema);
|
|
377
|
+
return new require_src.NumberEnvVarSchema({
|
|
378
|
+
process,
|
|
379
|
+
required: peeled.required,
|
|
380
|
+
default: typeof peeled.default === "number" ? peeled.default : void 0,
|
|
381
|
+
description: peeled.description
|
|
382
|
+
});
|
|
383
|
+
}
|
|
372
384
|
case "enum": {
|
|
373
385
|
const values = extractV4EnumValues(def) || [];
|
|
386
|
+
const process = createV4ProcessFunction(peeled.schema, "enum", schema);
|
|
374
387
|
return new require_src.EnumEnvVarSchema({
|
|
375
|
-
process
|
|
388
|
+
process,
|
|
376
389
|
values,
|
|
377
390
|
required: peeled.required,
|
|
378
391
|
default: typeof peeled.default === "string" ? peeled.default : void 0,
|
|
379
392
|
description: peeled.description
|
|
380
393
|
});
|
|
381
394
|
}
|
|
382
|
-
case "string":
|
|
383
395
|
default: {
|
|
384
396
|
const process = createV4ProcessFunction(peeled.schema, "string", schema);
|
|
385
397
|
const defaultValue = typeof peeled.default === "string" ? peeled.default : void 0;
|
|
@@ -392,7 +404,6 @@ function convertFromZodV4Schema(schema) {
|
|
|
392
404
|
}
|
|
393
405
|
}
|
|
394
406
|
}
|
|
395
|
-
|
|
396
407
|
//#endregion
|
|
397
408
|
//#region ../converters/src/converters/joi/JoiConverter.ts
|
|
398
409
|
/**
|
|
@@ -502,14 +513,13 @@ function resolveJoiEnvVarType(schema) {
|
|
|
502
513
|
*/
|
|
503
514
|
function createJoiProcessFunction(schema, type) {
|
|
504
515
|
return (value) => {
|
|
505
|
-
if (typeof value !== "string") throw new Error("Value must be a string");
|
|
506
516
|
try {
|
|
507
517
|
let processValue = value;
|
|
508
|
-
if (type === "number") {
|
|
518
|
+
if (typeof value === "string" && type === "number") {
|
|
509
519
|
const num = Number(value);
|
|
510
|
-
if (Number.
|
|
520
|
+
if (!Number.isFinite(num)) throw new Error(`Expected number, received "${value}"`);
|
|
511
521
|
processValue = num;
|
|
512
|
-
} else if (type === "boolean") {
|
|
522
|
+
} else if (typeof value === "string" && type === "boolean") {
|
|
513
523
|
const lower = value.toLowerCase().trim();
|
|
514
524
|
if ([
|
|
515
525
|
"true",
|
|
@@ -548,38 +558,46 @@ function convertFromJoiSchema(schema) {
|
|
|
548
558
|
const defaultValue = getJoiDefaultValue(schema);
|
|
549
559
|
const description = getJoiDescription(schema);
|
|
550
560
|
switch (type) {
|
|
551
|
-
case "boolean":
|
|
552
|
-
process
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
561
|
+
case "boolean": {
|
|
562
|
+
const process = createJoiProcessFunction(schema, "boolean");
|
|
563
|
+
return new require_src.BooleanEnvVarSchema({
|
|
564
|
+
process,
|
|
565
|
+
required,
|
|
566
|
+
default: typeof defaultValue === "boolean" ? defaultValue : void 0,
|
|
567
|
+
description
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
case "number": {
|
|
571
|
+
const process = createJoiProcessFunction(schema, "number");
|
|
572
|
+
return new require_src.NumberEnvVarSchema({
|
|
573
|
+
process,
|
|
574
|
+
required,
|
|
575
|
+
default: typeof defaultValue === "number" ? defaultValue : void 0,
|
|
576
|
+
description
|
|
577
|
+
});
|
|
578
|
+
}
|
|
563
579
|
case "enum": {
|
|
564
580
|
const values = getJoiValidValues(schema) || [];
|
|
581
|
+
const process = createJoiProcessFunction(schema, "enum");
|
|
565
582
|
return new require_src.EnumEnvVarSchema({
|
|
566
|
-
process
|
|
583
|
+
process,
|
|
567
584
|
values,
|
|
568
585
|
required,
|
|
569
586
|
default: typeof defaultValue === "string" ? defaultValue : void 0,
|
|
570
587
|
description
|
|
571
588
|
});
|
|
572
589
|
}
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
590
|
+
default: {
|
|
591
|
+
const process = createJoiProcessFunction(schema, "string");
|
|
592
|
+
return new require_src.StringEnvVarSchema({
|
|
593
|
+
process,
|
|
594
|
+
required,
|
|
595
|
+
default: typeof defaultValue === "string" ? defaultValue : void 0,
|
|
596
|
+
description
|
|
597
|
+
});
|
|
598
|
+
}
|
|
580
599
|
}
|
|
581
600
|
}
|
|
582
|
-
|
|
583
601
|
//#endregion
|
|
584
602
|
//#region ../converters/src/converters/superstruct/SuperstructConverter.ts
|
|
585
603
|
/**
|
|
@@ -613,31 +631,39 @@ function convertFromSuperstruct(schema) {
|
|
|
613
631
|
const values = extractEnumValues(schema);
|
|
614
632
|
if (!values || values.length === 0) return createStringEnvVarSchema(schema, required, defaultValue, description);
|
|
615
633
|
const readonlyValues = values;
|
|
634
|
+
const process = createSuperstructProcessFunction(schema, "enum");
|
|
616
635
|
return new require_src.EnumEnvVarSchema({
|
|
617
|
-
process
|
|
636
|
+
process,
|
|
618
637
|
values: readonlyValues,
|
|
619
638
|
required,
|
|
620
639
|
default: typeof defaultValue === "string" ? defaultValue : void 0,
|
|
621
640
|
description
|
|
622
641
|
});
|
|
623
642
|
}
|
|
624
|
-
if (resolvedType === "boolean")
|
|
625
|
-
process
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
643
|
+
if (resolvedType === "boolean") {
|
|
644
|
+
const process = createSuperstructProcessFunction(schema, "boolean");
|
|
645
|
+
return new require_src.BooleanEnvVarSchema({
|
|
646
|
+
process,
|
|
647
|
+
required,
|
|
648
|
+
default: typeof defaultValue === "boolean" ? defaultValue : void 0,
|
|
649
|
+
description
|
|
650
|
+
});
|
|
651
|
+
}
|
|
652
|
+
if (resolvedType === "number") {
|
|
653
|
+
const process = createSuperstructProcessFunction(schema, "number");
|
|
654
|
+
return new require_src.NumberEnvVarSchema({
|
|
655
|
+
process,
|
|
656
|
+
required,
|
|
657
|
+
default: typeof defaultValue === "number" ? defaultValue : void 0,
|
|
658
|
+
description
|
|
659
|
+
});
|
|
660
|
+
}
|
|
636
661
|
return createStringEnvVarSchema(schema, required, defaultValue, description);
|
|
637
662
|
}
|
|
638
663
|
function createStringEnvVarSchema(schema, required, defaultValue, description) {
|
|
664
|
+
const process = createSuperstructProcessFunction(schema, "string");
|
|
639
665
|
return new require_src.StringEnvVarSchema({
|
|
640
|
-
process
|
|
666
|
+
process,
|
|
641
667
|
required,
|
|
642
668
|
default: typeof defaultValue === "string" ? defaultValue : void 0,
|
|
643
669
|
description
|
|
@@ -692,9 +718,8 @@ function getStructDescription(schema) {
|
|
|
692
718
|
}
|
|
693
719
|
function createSuperstructProcessFunction(schema, type) {
|
|
694
720
|
return (value) => {
|
|
695
|
-
if (typeof value !== "string") throw new Error("Value must be a string");
|
|
696
721
|
let candidate = value;
|
|
697
|
-
if (type === "number") {
|
|
722
|
+
if (typeof value === "string" && type === "number") {
|
|
698
723
|
const trimmed = value.trim();
|
|
699
724
|
if (trimmed === "") candidate = void 0;
|
|
700
725
|
else {
|
|
@@ -702,7 +727,7 @@ function createSuperstructProcessFunction(schema, type) {
|
|
|
702
727
|
if (Number.isNaN(parsed) || !Number.isFinite(parsed)) throw new Error(`"${value}" is not a valid number`);
|
|
703
728
|
candidate = parsed;
|
|
704
729
|
}
|
|
705
|
-
} else if (type === "boolean") {
|
|
730
|
+
} else if (typeof value === "string" && type === "boolean") {
|
|
706
731
|
const trimmed = value.trim().toLowerCase();
|
|
707
732
|
if (trimmed === "") candidate = void 0;
|
|
708
733
|
else if ([
|
|
@@ -726,7 +751,6 @@ function createSuperstructProcessFunction(schema, type) {
|
|
|
726
751
|
return result;
|
|
727
752
|
};
|
|
728
753
|
}
|
|
729
|
-
|
|
730
754
|
//#endregion
|
|
731
755
|
//#region ../converters/src/converters.ts
|
|
732
756
|
/**
|
|
@@ -738,7 +762,6 @@ const converters = [
|
|
|
738
762
|
new JoiConverter(),
|
|
739
763
|
new SuperstructConverter()
|
|
740
764
|
];
|
|
741
|
-
|
|
742
765
|
//#endregion
|
|
743
766
|
//#region ../models/src/resolve.ts
|
|
744
767
|
/**
|
|
@@ -753,7 +776,7 @@ const converters = [
|
|
|
753
776
|
* @throws Error if no converter can handle the schema
|
|
754
777
|
*/
|
|
755
778
|
function resolveSchema(schema) {
|
|
756
|
-
if (
|
|
779
|
+
if (require_EnvVarSchema.isEnvVarSchema(schema)) return schema;
|
|
757
780
|
for (const converter of converters) if (converter.applies(schema)) return converter.convert(schema);
|
|
758
781
|
throw new Error(`No converter found for schema. Supported types: Zod v3, Zod v4, Joi, Superstruct, EnvVarSchema. Received: ${typeof schema}`);
|
|
759
782
|
}
|
|
@@ -780,7 +803,6 @@ function resolveSchemas(schemas) {
|
|
|
780
803
|
}
|
|
781
804
|
return resolved;
|
|
782
805
|
}
|
|
783
|
-
|
|
784
806
|
//#endregion
|
|
785
807
|
//#region ../models/src/EnvModel.ts
|
|
786
808
|
/**
|
|
@@ -820,7 +842,6 @@ var EnvModel = class {
|
|
|
820
842
|
return { ...config };
|
|
821
843
|
}
|
|
822
844
|
};
|
|
823
|
-
|
|
824
845
|
//#endregion
|
|
825
846
|
//#region ../models/src/model.ts
|
|
826
847
|
/**
|
|
@@ -848,29 +869,28 @@ var EnvModel = class {
|
|
|
848
869
|
function define(options) {
|
|
849
870
|
return new EnvModel(options);
|
|
850
871
|
}
|
|
851
|
-
|
|
852
872
|
//#endregion
|
|
853
|
-
Object.defineProperty(exports,
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
873
|
+
Object.defineProperty(exports, "EnvModel", {
|
|
874
|
+
enumerable: true,
|
|
875
|
+
get: function() {
|
|
876
|
+
return EnvModel;
|
|
877
|
+
}
|
|
858
878
|
});
|
|
859
|
-
Object.defineProperty(exports,
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
879
|
+
Object.defineProperty(exports, "define", {
|
|
880
|
+
enumerable: true,
|
|
881
|
+
get: function() {
|
|
882
|
+
return define;
|
|
883
|
+
}
|
|
884
|
+
});
|
|
885
|
+
Object.defineProperty(exports, "resolveSchema", {
|
|
886
|
+
enumerable: true,
|
|
887
|
+
get: function() {
|
|
888
|
+
return resolveSchema;
|
|
889
|
+
}
|
|
864
890
|
});
|
|
865
|
-
Object.defineProperty(exports,
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
891
|
+
Object.defineProperty(exports, "resolveSchemas", {
|
|
892
|
+
enumerable: true,
|
|
893
|
+
get: function() {
|
|
894
|
+
return resolveSchemas;
|
|
895
|
+
}
|
|
870
896
|
});
|
|
871
|
-
Object.defineProperty(exports, 'resolveSchemas', {
|
|
872
|
-
enumerable: true,
|
|
873
|
-
get: function () {
|
|
874
|
-
return resolveSchemas;
|
|
875
|
-
}
|
|
876
|
-
});
|