arkenv 1.0.0-alpha.0 → 1.0.0-alpha.10

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.
@@ -1,204 +0,0 @@
1
- import * as _$arktype from "arktype";
2
- import { Type, type } from "arktype";
3
- import * as _$arktype_internal_keywords_string_ts0 from "arktype/internal/keywords/string.ts";
4
- import * as _$arktype_internal_attributes_ts0 from "arktype/internal/attributes.ts";
5
-
6
- //#region ../internal/scope/dist/index.d.ts
7
- //#region src/root.d.ts
8
- /**
9
- * The root scope for the ArkEnv library,
10
- * containing extensions to the ArkType scopes with ArkEnv-specific types
11
- * like `string.host` and `number.port`.
12
- */
13
- declare const $: _$arktype.Scope<{
14
- string: _$arktype.Submodule<{
15
- trim: _$arktype.Submodule<_$arktype_internal_keywords_string_ts0.trim.$ & {
16
- " arkInferred": (In: string) => _$arktype_internal_attributes_ts0.To<string>;
17
- }>;
18
- normalize: _$arktype.Submodule<_$arktype_internal_keywords_string_ts0.normalize.$ & {
19
- " arkInferred": (In: string) => _$arktype_internal_attributes_ts0.To<string>;
20
- }>;
21
- root: string;
22
- alpha: string;
23
- alphanumeric: string;
24
- hex: string;
25
- base64: _$arktype.Submodule<{
26
- root: string;
27
- url: string;
28
- } & {
29
- " arkInferred": string;
30
- }>;
31
- capitalize: _$arktype.Submodule<_$arktype_internal_keywords_string_ts0.capitalize.$ & {
32
- " arkInferred": (In: string) => _$arktype_internal_attributes_ts0.To<string>;
33
- }>;
34
- creditCard: string;
35
- date: _$arktype.Submodule<_$arktype_internal_keywords_string_ts0.stringDate.$ & {
36
- " arkInferred": string;
37
- }>;
38
- digits: string;
39
- email: string;
40
- integer: _$arktype.Submodule<_$arktype_internal_keywords_string_ts0.stringInteger.$ & {
41
- " arkInferred": string;
42
- }>;
43
- ip: _$arktype.Submodule<_$arktype_internal_keywords_string_ts0.ip.$ & {
44
- " arkInferred": string;
45
- }>;
46
- json: _$arktype.Submodule<_$arktype_internal_keywords_string_ts0.stringJson.$ & {
47
- " arkInferred": string;
48
- }>;
49
- lower: _$arktype.Submodule<_$arktype_internal_keywords_string_ts0.lower.$ & {
50
- " arkInferred": (In: string) => _$arktype_internal_attributes_ts0.To<string>;
51
- }>;
52
- numeric: _$arktype.Submodule<_$arktype_internal_keywords_string_ts0.stringNumeric.$ & {
53
- " arkInferred": string;
54
- }>;
55
- regex: string;
56
- semver: string;
57
- upper: _$arktype.Submodule<{
58
- root: (In: string) => _$arktype_internal_attributes_ts0.To<string>;
59
- preformatted: string;
60
- } & {
61
- " arkInferred": (In: string) => _$arktype_internal_attributes_ts0.To<string>;
62
- }>;
63
- url: _$arktype.Submodule<_$arktype_internal_keywords_string_ts0.url.$ & {
64
- " arkInferred": string;
65
- }>;
66
- uuid: _$arktype.Submodule<_$arktype_internal_keywords_string_ts0.uuid.$ & {
67
- " arkInferred": string;
68
- }>;
69
- " arkInferred": string;
70
- host: string;
71
- }>;
72
- number: _$arktype.Submodule<{
73
- NaN: number;
74
- Infinity: number;
75
- root: number;
76
- integer: number;
77
- " arkInferred": number;
78
- epoch: number;
79
- safe: number;
80
- NegativeInfinity: number;
81
- port: number;
82
- }>;
83
- }>;
84
- type $ = (typeof $)["t"]; //#endregion
85
- //#endregion
86
- //#region ../internal/types/dist/helpers.d.ts
87
- type Dict<T> = Record<string, T | undefined>;
88
- //#endregion
89
- //#region ../internal/types/dist/standard-schema.d.ts
90
- /**
91
- * @see https://github.com/standard-schema/standard-schema/tree/3130ce43fdd848d9ab49dbb0458d04f18459961c/packages/spec
92
- *
93
- * Copied from standard-schema (MIT License)
94
- * Copyright (c) 2024 Colin McDannell
95
- */
96
- /** The Standard Typed interface. This is a base type extended by other specs. */
97
- interface StandardTypedV1<Input = unknown, Output = Input> {
98
- /** The Standard properties. */
99
- readonly "~standard": StandardTypedV1.Props<Input, Output>;
100
- }
101
- declare namespace StandardTypedV1 {
102
- /** The Standard Typed properties interface. */
103
- interface Props<Input = unknown, Output = Input> {
104
- /** The version number of the standard. */
105
- readonly version: 1;
106
- /** The vendor name of the schema library. */
107
- readonly vendor: string;
108
- /** Inferred types associated with the schema. */
109
- readonly types?: Types<Input, Output> | undefined;
110
- }
111
- /** The Standard Typed types interface. */
112
- interface Types<Input = unknown, Output = Input> {
113
- /** The input type of the schema. */
114
- readonly input: Input;
115
- /** The output type of the schema. */
116
- readonly output: Output;
117
- }
118
- /** Infers the input type of a Standard Typed. */
119
- type InferInput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["input"];
120
- /** Infers the output type of a Standard Typed. */
121
- type InferOutput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["output"];
122
- }
123
- /** The Standard Schema interface. */
124
- interface StandardSchemaV1<Input = unknown, Output = Input> {
125
- /** The Standard Schema properties. */
126
- readonly "~standard": StandardSchemaV1.Props<Input, Output>;
127
- }
128
- declare namespace StandardSchemaV1 {
129
- /** The Standard Schema properties interface. */
130
- interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
131
- /** Validates unknown input values. */
132
- readonly validate: (value: unknown, options?: StandardSchemaV1.Options | undefined) => Result<Output> | Promise<Result<Output>>;
133
- }
134
- /** The result interface of the validate function. */
135
- type Result<Output> = SuccessResult<Output> | FailureResult;
136
- /** The result interface if validation succeeds. */
137
- interface SuccessResult<Output> {
138
- /** The typed output value. */
139
- readonly value: Output;
140
- /** A falsy value for `issues` indicates success. */
141
- readonly issues?: undefined;
142
- }
143
- interface Options {
144
- /** Explicit support for additional vendor-specific parameters, if needed. */
145
- readonly libraryOptions?: Record<string, unknown> | undefined;
146
- }
147
- /** The result interface if validation fails. */
148
- interface FailureResult {
149
- /** The issues of failed validation. */
150
- readonly issues: ReadonlyArray<Issue>;
151
- }
152
- /** The issue interface of the failure output. */
153
- interface Issue {
154
- /** The error message of the issue. */
155
- readonly message: string;
156
- /** The path of the issue, if any. */
157
- readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
158
- }
159
- /** The path segment interface of the issue. */
160
- interface PathSegment {
161
- /** The key representing a path segment. */
162
- readonly key: PropertyKey;
163
- }
164
- /** The Standard types interface. */
165
- interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {}
166
- /** Infers the input type of a Standard. */
167
- type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
168
- /** Infers the output type of a Standard. */
169
- type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
170
- }
171
- //#endregion
172
- //#region ../internal/types/dist/infer-type.d.ts
173
- /**
174
- * Extract the inferred type from a schema definition.
175
- * Supports both ArkType type definitions and Standard Schema 1.0 validators.
176
- *
177
- * For Standard Schema validators (e.g., Zod, Valibot), extracts the output type.
178
- * For ArkType definitions, checks the call signature or type properties.
179
- *
180
- * @template T - The schema definition to infer from
181
- */
182
- type InferType<T> = T extends StandardSchemaV1<infer _Input, infer Output> ? Output : T extends ((value: Record<string, string | undefined>) => infer R) ? R extends type.errors ? never : R : T extends {
183
- t: infer U;
184
- } ? U : T extends type.Any<infer U, infer _Scope> ? U : never;
185
- //#endregion
186
- //#region ../internal/types/dist/schema.d.ts
187
- type SchemaShape = Record<string, unknown>;
188
- /**
189
- * @internal
190
- *
191
- * Compiled ArkType schema accepted by ArkEnv.
192
- * Produced by `arktype.type(...)` or `scope(...)`.
193
- *
194
- * Represents an already-constructed ArkType `Type` instance that
195
- * defines the full environment schema.
196
- *
197
- * This form bypasses schema validation and is intended for advanced
198
- * or programmatic use cases where schemas are constructed dynamically.
199
- */
200
- type CompiledEnvSchema = Type<SchemaShape, $>;
201
- //#endregion
202
- export { Dict as a, StandardSchemaV1 as i, SchemaShape as n, $ as o, InferType as r, CompiledEnvSchema as t };
203
-
204
- //# sourceMappingURL=index-Br22fqkz.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-Br22fqkz.d.mts","names":["_$arktype","_$arktype_internal_keywords_string_ts0","_$arktype_internal_attributes_ts0","$","trim","To","Submodule","normalize","capitalize","stringDate","stringInteger","ip","stringJson","lower","stringNumeric","url","uuid","Scope","string","In","root","alpha","alphanumeric","hex","base64","creditCard","date","digits","email","integer","json","numeric","regex","semver","upper","preformatted","host","number","NaN","Infinity","epoch","safe","NegativeInfinity","port","Dict","T","Record","StandardTypedV1","Input","Output","Props","Schema","Types","NonNullable","version","vendor","types","input","output","InferInput","InferOutput","StandardSchemaV1","Options","Result","Promise","SuccessResult","FailureResult","Record","Issue","ReadonlyArray","PropertyKey","PathSegment","validate","value","options","issues","libraryOptions","message","path","key","StandardJSONSchemaV1","Converter","Target","jsonSchema","target","type","StandardSchemaV1","InferType","T","Record","errors","Any","_Input","Output","value","R","t","U","_Scope","$","Type","SchemaShape","Record","CompiledEnvSchema"],"sources":["../../internal/scope/dist/index.d.ts","../../internal/types/dist/helpers.d.ts","../../internal/types/dist/standard-schema.d.ts","../../internal/types/dist/infer-type.d.ts","../../internal/types/dist/schema.d.ts"],"mappings":";;;;;;;;AAEoF;;;;cAQtEG,CAAAA,EAAGH,SAAAA,CAAUiB,KAAAA;EACzBC,MAAAA,EAAQlB,SAAAA,CAAUM,SAAAA;IAChBF,IAAAA,EAAMJ,SAAAA,CAAUM,SAAAA,CAAUL,sCAAAA,CAAuCG,IAAAA,CAAKD,CAAAA;MACpE,cAAA,GAAiBgB,EAAAA,aAAejB,iCAAAA,CAAkCG,EAAAA;IAAAA;IAEpEE,SAAAA,EAAWP,SAAAA,CAAUM,SAAAA,CAAUL,sCAAAA,CAAuCM,SAAAA,CAAUJ,CAAAA;MAC9E,cAAA,GAAiBgB,EAAAA,aAAejB,iCAAAA,CAAkCG,EAAAA;IAAAA;IAEpEe,IAAAA;IACAC,KAAAA;IACAC,YAAAA;IACAC,GAAAA;IACAC,MAAAA,EAAQxB,SAAAA,CAAUM,SAAAA;MAChBc,IAAAA;MACAL,GAAAA;IAAAA;MAEA,cAAA;IAAA;IAEFP,UAAAA,EAAYR,SAAAA,CAAUM,SAAAA,CAAUL,sC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GSxEoC,SAAAA,MAAeC,CAAAA,SAAUF,gBAAAA,+BAA+CO,MAAAA,GAASL,CAAAA,WAAWM,KAAAA,EAAOL,MAAAA,4CAAiDM,CAAAA,SAAUV,IAAAA,CAAKK,MAAAA,WAAiBK,CAAAA,GAAIP,CAAAA;EAChMQ,CAAAA;AAAAA,IACAC,CAAAA,GAAIT,CAAAA,SAAUH,IAAAA,CAAKM,GAAAA,0BAA6BM,CAAAA;;;KCXxCI,WAAAA,GAAcC,MAAAA;;;;AJA0D;;;;;;;;;KIaxEC,iBAAAA,GAAoBH,IAAAA,CAAKC,WAAAA,EAAaF,CAAAA"}
@@ -1,210 +0,0 @@
1
- import * as _$arktype_internal_keywords_string_ts0 from "arktype/internal/keywords/string.ts";
2
- import * as _$arktype_internal_attributes_ts0 from "arktype/internal/attributes.ts";
3
- import * as _$arktype from "arktype";
4
- import { Type, type } from "arktype";
5
-
6
- //#region ../internal/scope/dist/index.d.ts
7
- //#region src/root.d.ts
8
- /**
9
- * The root scope for the ArkEnv library,
10
- * containing extensions to the ArkType scopes with ArkEnv-specific types
11
- * like `string.host` and `number.port`.
12
- */
13
- declare const $: _$arktype.Scope<{
14
- string: _$arktype.Submodule<{
15
- trim: _$arktype.Submodule<_$arktype_internal_keywords_string_ts0.trim.$ & {
16
- " arkInferred": (In: string) => _$arktype_internal_attributes_ts0.To<string>;
17
- }>;
18
- normalize: _$arktype.Submodule<_$arktype_internal_keywords_string_ts0.normalize.$ & {
19
- " arkInferred": (In: string) => _$arktype_internal_attributes_ts0.To<string>;
20
- }>;
21
- root: string;
22
- alpha: string;
23
- alphanumeric: string;
24
- hex: string;
25
- base64: _$arktype.Submodule<{
26
- root: string;
27
- url: string;
28
- } & {
29
- " arkInferred": string;
30
- }>;
31
- capitalize: _$arktype.Submodule<_$arktype_internal_keywords_string_ts0.capitalize.$ & {
32
- " arkInferred": (In: string) => _$arktype_internal_attributes_ts0.To<string>;
33
- }>;
34
- creditCard: string;
35
- date: _$arktype.Submodule<_$arktype_internal_keywords_string_ts0.stringDate.$ & {
36
- " arkInferred": string;
37
- }>;
38
- digits: string;
39
- email: string;
40
- integer: _$arktype.Submodule<_$arktype_internal_keywords_string_ts0.stringInteger.$ & {
41
- " arkInferred": string;
42
- }>;
43
- ip: _$arktype.Submodule<_$arktype_internal_keywords_string_ts0.ip.$ & {
44
- " arkInferred": string;
45
- }>;
46
- json: _$arktype.Submodule<_$arktype_internal_keywords_string_ts0.stringJson.$ & {
47
- " arkInferred": string;
48
- }>;
49
- lower: _$arktype.Submodule<_$arktype_internal_keywords_string_ts0.lower.$ & {
50
- " arkInferred": (In: string) => _$arktype_internal_attributes_ts0.To<string>;
51
- }>;
52
- numeric: _$arktype.Submodule<_$arktype_internal_keywords_string_ts0.stringNumeric.$ & {
53
- " arkInferred": string;
54
- }>;
55
- regex: string;
56
- semver: string;
57
- upper: _$arktype.Submodule<{
58
- root: (In: string) => _$arktype_internal_attributes_ts0.To<string>;
59
- preformatted: string;
60
- } & {
61
- " arkInferred": (In: string) => _$arktype_internal_attributes_ts0.To<string>;
62
- }>;
63
- url: _$arktype.Submodule<_$arktype_internal_keywords_string_ts0.url.$ & {
64
- " arkInferred": string;
65
- }>;
66
- uuid: _$arktype.Submodule<_$arktype_internal_keywords_string_ts0.uuid.$ & {
67
- " arkInferred": string;
68
- }>;
69
- " arkInferred": string;
70
- host: string;
71
- }>;
72
- number: _$arktype.Submodule<{
73
- NaN: number;
74
- Infinity: number;
75
- root: number;
76
- integer: number;
77
- " arkInferred": number;
78
- epoch: number;
79
- safe: number;
80
- NegativeInfinity: number;
81
- port: number;
82
- }>;
83
- }>;
84
- type $ = (typeof $)["t"]; //#endregion
85
- //#endregion
86
- //#region ../internal/types/dist/helpers.d.ts
87
- type Dict<T> = Record<string, T | undefined>;
88
- //#endregion
89
- //#region ../internal/types/dist/standard-schema.d.ts
90
- /**
91
- * @see https://github.com/standard-schema/standard-schema/tree/3130ce43fdd848d9ab49dbb0458d04f18459961c/packages/spec
92
- *
93
- * Copied from standard-schema (MIT License)
94
- * Copyright (c) 2024 Colin McDannell
95
- */
96
- /** The Standard Typed interface. This is a base type extended by other specs. */
97
- interface StandardTypedV1<Input = unknown, Output = Input> {
98
- /** The Standard properties. */
99
- readonly "~standard": StandardTypedV1.Props<Input, Output>;
100
- }
101
- declare namespace StandardTypedV1 {
102
- /** The Standard Typed properties interface. */
103
- interface Props<Input = unknown, Output = Input> {
104
- /** The version number of the standard. */
105
- readonly version: 1;
106
- /** The vendor name of the schema library. */
107
- readonly vendor: string;
108
- /** Inferred types associated with the schema. */
109
- readonly types?: Types<Input, Output> | undefined;
110
- }
111
- /** The Standard Typed types interface. */
112
- interface Types<Input = unknown, Output = Input> {
113
- /** The input type of the schema. */
114
- readonly input: Input;
115
- /** The output type of the schema. */
116
- readonly output: Output;
117
- }
118
- /** Infers the input type of a Standard Typed. */
119
- type InferInput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["input"];
120
- /** Infers the output type of a Standard Typed. */
121
- type InferOutput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["output"];
122
- }
123
- /** The Standard Schema interface. */
124
- interface StandardSchemaV1<Input = unknown, Output = Input> {
125
- /** The Standard Schema properties. */
126
- readonly "~standard": StandardSchemaV1.Props<Input, Output>;
127
- }
128
- declare namespace StandardSchemaV1 {
129
- /** The Standard Schema properties interface. */
130
- interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
131
- /** Validates unknown input values. */
132
- readonly validate: (value: unknown, options?: StandardSchemaV1.Options | undefined) => Result<Output> | Promise<Result<Output>>;
133
- }
134
- /** The result interface of the validate function. */
135
- type Result<Output> = SuccessResult<Output> | FailureResult;
136
- /** The result interface if validation succeeds. */
137
- interface SuccessResult<Output> {
138
- /** The typed output value. */
139
- readonly value: Output;
140
- /** A falsy value for `issues` indicates success. */
141
- readonly issues?: undefined;
142
- }
143
- interface Options {
144
- /** Explicit support for additional vendor-specific parameters, if needed. */
145
- readonly libraryOptions?: Record<string, unknown> | undefined;
146
- }
147
- /** The result interface if validation fails. */
148
- interface FailureResult {
149
- /** The issues of failed validation. */
150
- readonly issues: ReadonlyArray<Issue>;
151
- }
152
- /** The issue interface of the failure output. */
153
- interface Issue {
154
- /** The error message of the issue. */
155
- readonly message: string;
156
- /** The path of the issue, if any. */
157
- readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
158
- }
159
- /** The path segment interface of the issue. */
160
- interface PathSegment {
161
- /** The key representing a path segment. */
162
- readonly key: PropertyKey;
163
- }
164
- /** The Standard types interface. */
165
- interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {}
166
- /** Infers the input type of a Standard. */
167
- type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
168
- /** Infers the output type of a Standard. */
169
- type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
170
- }
171
- //#endregion
172
- //#region ../internal/types/dist/infer-type.d.ts
173
- /**
174
- * Extract the inferred type from a schema definition.
175
- * Supports both ArkType type definitions and Standard Schema 1.0 validators.
176
- *
177
- * For Standard Schema validators (e.g., Zod, Valibot), extracts the output type.
178
- * For ArkType definitions, checks the call signature or type properties.
179
- *
180
- * @template T - The schema definition to infer from
181
- */
182
- type InferType<T> = T extends StandardSchemaV1<infer _Input, infer Output> ? Output : T extends ((value: Record<string, string | undefined>) => infer R) ? R extends type.errors ? never : R : T extends {
183
- t: infer U;
184
- } ? U : T extends type.Any<infer U, infer _Scope> ? U : never;
185
- //#endregion
186
- //#region ../internal/types/dist/schema.d.ts
187
- type SchemaShape = Record<string, unknown>;
188
- /**
189
- * @internal
190
- *
191
- * Compiled ArkType schema accepted by ArkEnv.
192
- * Produced by `arktype.type(...)` or `scope(...)`.
193
- *
194
- * Represents an already-constructed ArkType `Type` instance that
195
- * defines the full environment schema.
196
- *
197
- * This form bypasses schema validation and is intended for advanced
198
- * or programmatic use cases where schemas are constructed dynamically.
199
- */
200
- type CompiledEnvSchema = Type<SchemaShape, $>;
201
- //#endregion
202
- export { Dict as a, StandardSchemaV1 as i, SchemaShape as n, $ as o, InferType as r, CompiledEnvSchema as t };
203
-
204
- // CJS Interop Shim
205
- if (module.exports && module.exports.default) {
206
- Object.assign(module.exports.default, module.exports);
207
- module.exports = module.exports.default;
208
- }
209
-
210
- //# sourceMappingURL=index-CzNfOanV.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-CzNfOanV.d.cts","names":["_$arktype","_$arktype_internal_keywords_string_ts0","_$arktype_internal_attributes_ts0","$","trim","To","Submodule","normalize","capitalize","stringDate","stringInteger","ip","stringJson","lower","stringNumeric","url","uuid","Scope","string","In","root","alpha","alphanumeric","hex","base64","creditCard","date","digits","email","integer","json","numeric","regex","semver","upper","preformatted","host","number","NaN","Infinity","epoch","safe","NegativeInfinity","port","Dict","T","Record","StandardTypedV1","Input","Output","Props","Schema","Types","NonNullable","version","vendor","types","input","output","InferInput","InferOutput","StandardSchemaV1","Options","Result","Promise","SuccessResult","FailureResult","Record","Issue","ReadonlyArray","PropertyKey","PathSegment","validate","value","options","issues","libraryOptions","message","path","key","StandardJSONSchemaV1","Converter","Target","jsonSchema","target","type","StandardSchemaV1","InferType","T","Record","errors","Any","_Input","Output","value","R","t","U","_Scope","$","Type","SchemaShape","Record","CompiledEnvSchema"],"sources":["../../internal/scope/dist/index.d.ts","../../internal/types/dist/helpers.d.ts","../../internal/types/dist/standard-schema.d.ts","../../internal/types/dist/infer-type.d.ts","../../internal/types/dist/schema.d.ts"],"mappings":";;;;;;;;AAEoF;;;;cAQtEG,CAAAA,EAAGH,SAAAA,CAAUiB,KAAAA;EACzBC,MAAAA,EAAQlB,SAAAA,CAAUM,SAAAA;IAChBF,IAAAA,EAAMJ,SAAAA,CAAUM,SAAAA,CAAUL,sCAAAA,CAAuCG,IAAAA,CAAKD,CAAAA;MACpE,cAAA,GAAiBgB,EAAAA,aAAejB,iCAAAA,CAAkCG,EAAAA;IA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A5B6B;AAK9B;;;;;;;EAiCC,WAAA;EAAA;;;;AA2BD;;;;;EAhBC,gBAAA;AAAA;;;;;;;;;;;;;iBAgBe,SAAA,iBAA0B,WAAA,CAAA,CACzC,GAAA,EAAK,SAAA,CAAU,CAAA,GACf,MAAA,GAAS,YAAA,GACP,OAAA,CAAQ,GAAA,CAAI,MAAA,CAAG,KAAA,CAAM,CAAA,EAAG,CAAA;AAAA,iBACX,SAAA,WAAoB,iBAAA,CAAA,CACnC,GAAA,EAAK,CAAA,EACL,MAAA,GAAS,YAAA,GACP,SAAA,CAAU,CAAA;AAAA,iBACG,SAAA,iBAA0B,WAAA,CAAA,CACzC,GAAA,EAAK,SAAA,CAAU,CAAA,IAAK,iBAAA,EACpB,MAAA,GAAS,YAAA,GACP,OAAA,CAAQ,GAAA,CAAI,MAAA,CAAG,KAAA,CAAM,CAAA,EAAG,CAAA,KAAM,SAAA,QAAiB,GAAA;;;;;;;;;AAxFlD;;;cCZa,IAAA,8BAAI,UAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAQX,MAAA,SAAM,SAAA"}
package/dist/index.d.mts DELETED
@@ -1,185 +0,0 @@
1
- import { a as Dict, n as SchemaShape, o as $, r as InferType, t as CompiledEnvSchema } from "./index-Br22fqkz.mjs";
2
- import * as _$arktype from "arktype";
3
- import { distill, type as type$1 } from "arktype";
4
- import * as _$arktype_internal_keywords_string_ts0 from "arktype/internal/keywords/string.ts";
5
- import * as _$arktype_internal_attributes_ts0 from "arktype/internal/attributes.ts";
6
- import * as _$arktype_internal_type_ts0 from "arktype/internal/type.ts";
7
-
8
- //#region src/create-env.d.ts
9
- /**
10
- * Declarative environment schema definition accepted by ArkEnv.
11
- *
12
- * Represents a declarative schema object mapping environment
13
- * variable names to schema definitions (e.g. ArkType DSL strings
14
- * or Standard Schema validators).
15
- *
16
- * This type is used to validate that a schema object is compatible with
17
- * ArkEnv’s validator scope before being compiled or parsed.
18
- *
19
- * Most users will provide schemas in this form.
20
- *
21
- * @template def - The schema shape object
22
- */
23
- type EnvSchema<def> = type$1.validate<def, $>;
24
- /**
25
- * Infer the validated and coerced environment object type from a schema.
26
- * Supports declarative schema shapes, compiled ArkType schemas, and Standard Schema validators.
27
- *
28
- * @template T - The schema type
29
- */
30
- type Infer<T> = T extends SchemaShape ? distill.Out<type$1.infer<T, $>> : InferType<T>;
31
- type RuntimeEnvironment = Dict<string>;
32
- /**
33
- * Configuration options for `createEnv`
34
- */
35
- type ArkEnvConfig = {
36
- /**
37
- * The environment variables to parse. Defaults to `process.env`
38
- */
39
- env?: RuntimeEnvironment;
40
- /**
41
- * Whether to coerce environment variables to their defined types. Defaults to `true`
42
- */
43
- coerce?: boolean;
44
- /**
45
- * Control how ArkEnv handles environment variables that are not defined in your schema.
46
- *
47
- * Defaults to `'delete'` to ensure your output object only contains
48
- * keys you've explicitly declared. This differs from ArkType's standard behavior, which
49
- * mirrors TypeScript by defaulting to `'ignore'`.
50
- *
51
- * - `delete` (ArkEnv default): Undeclared keys are allowed on input but stripped from the output.
52
- * - `ignore` (ArkType default): Undeclared keys are allowed and preserved in the output.
53
- * - `reject`: Undeclared keys will cause validation to fail.
54
- *
55
- * @default "delete"
56
- * @see https://arktype.io/docs/configuration#onundeclaredkey
57
- */
58
- onUndeclaredKey?: "ignore" | "delete" | "reject";
59
- /**
60
- * The format to use for array parsing when coercion is enabled.
61
- *
62
- * - `comma` (default): Strings are split by comma and trimmed.
63
- * - `json`: Strings are parsed as JSON.
64
- *
65
- * @default "comma"
66
- */
67
- arrayFormat?: "comma" | "json";
68
- /**
69
- * Whether to treat empty strings (`""`) as `undefined` before validation.
70
- *
71
- * When enabled, an environment variable set to an empty value (e.g. `PORT=`)
72
- * will be treated as if it were missing, allowing defaults to apply and
73
- * preventing validation errors for numeric or boolean types.
74
- *
75
- * @default false
76
- */
77
- emptyAsUndefined?: boolean;
78
- };
79
- /**
80
- * TODO: `SchemaShape` is basically `Record<string, unknown>`.
81
- * If possible, find a better type than "const T extends Record<string, unknown>",
82
- * and be as close as possible to the type accepted by ArkType's `type`.
83
- */
84
- /**
85
- * Utility to parse environment variables using ArkType or Standard Schema
86
- * @param def - The schema definition
87
- * @param config - The evaluation configuration
88
- * @returns The parsed environment variables
89
- * @throws An {@link ArkEnvError | error} if the environment variables are invalid.
90
- */
91
- declare function createEnv<const T extends SchemaShape>(def: EnvSchema<T>, config?: ArkEnvConfig): distill.Out<type$1.infer<T, $>>;
92
- declare function createEnv<T extends CompiledEnvSchema>(def: T, config?: ArkEnvConfig): InferType<T>;
93
- declare function createEnv<const T extends SchemaShape>(def: EnvSchema<T> | CompiledEnvSchema, config?: ArkEnvConfig): distill.Out<type$1.infer<T, $>> | InferType<typeof def>;
94
- //#endregion
95
- //#region src/index.d.ts
96
- /**
97
- * Like ArkType's `type`, but with ArkEnv's extra keywords, such as:
98
- *
99
- * - `string.host` – a hostname (e.g. `"localhost"`, `"127.0.0.1"`)
100
- * - `number.port` – a port number (e.g. `8080`)
101
- *
102
- * See ArkType's docs for the full API:
103
- * https://arktype.io/docs/type-api
104
- */
105
- declare const type: _$arktype_internal_type_ts0.TypeParser<{
106
- string: _$arktype.Submodule<{
107
- trim: _$arktype.Submodule<_$arktype_internal_keywords_string_ts0.trim.$ & {
108
- " arkInferred": (In: string) => _$arktype_internal_attributes_ts0.To<string>;
109
- }>;
110
- normalize: _$arktype.Submodule<_$arktype_internal_keywords_string_ts0.normalize.$ & {
111
- " arkInferred": (In: string) => _$arktype_internal_attributes_ts0.To<string>;
112
- }>;
113
- root: string;
114
- alpha: string;
115
- alphanumeric: string;
116
- hex: string;
117
- base64: _$arktype.Submodule<{
118
- root: string;
119
- url: string;
120
- } & {
121
- " arkInferred": string;
122
- }>;
123
- capitalize: _$arktype.Submodule<_$arktype_internal_keywords_string_ts0.capitalize.$ & {
124
- " arkInferred": (In: string) => _$arktype_internal_attributes_ts0.To<string>;
125
- }>;
126
- creditCard: string;
127
- date: _$arktype.Submodule<_$arktype_internal_keywords_string_ts0.stringDate.$ & {
128
- " arkInferred": string;
129
- }>;
130
- digits: string;
131
- email: string;
132
- integer: _$arktype.Submodule<_$arktype_internal_keywords_string_ts0.stringInteger.$ & {
133
- " arkInferred": string;
134
- }>;
135
- ip: _$arktype.Submodule<_$arktype_internal_keywords_string_ts0.ip.$ & {
136
- " arkInferred": string;
137
- }>;
138
- json: _$arktype.Submodule<_$arktype_internal_keywords_string_ts0.stringJson.$ & {
139
- " arkInferred": string;
140
- }>;
141
- lower: _$arktype.Submodule<_$arktype_internal_keywords_string_ts0.lower.$ & {
142
- " arkInferred": (In: string) => _$arktype_internal_attributes_ts0.To<string>;
143
- }>;
144
- numeric: _$arktype.Submodule<_$arktype_internal_keywords_string_ts0.stringNumeric.$ & {
145
- " arkInferred": string;
146
- }>;
147
- regex: string;
148
- semver: string;
149
- upper: _$arktype.Submodule<{
150
- root: (In: string) => _$arktype_internal_attributes_ts0.To<string>;
151
- preformatted: string;
152
- } & {
153
- " arkInferred": (In: string) => _$arktype_internal_attributes_ts0.To<string>;
154
- }>;
155
- url: _$arktype.Submodule<_$arktype_internal_keywords_string_ts0.url.$ & {
156
- " arkInferred": string;
157
- }>;
158
- uuid: _$arktype.Submodule<_$arktype_internal_keywords_string_ts0.uuid.$ & {
159
- " arkInferred": string;
160
- }>;
161
- " arkInferred": string;
162
- host: string;
163
- }>;
164
- number: _$arktype.Submodule<{
165
- NaN: number;
166
- Infinity: number;
167
- root: number;
168
- integer: number;
169
- " arkInferred": number;
170
- epoch: number;
171
- safe: number;
172
- NegativeInfinity: number;
173
- port: number;
174
- }>;
175
- }>;
176
- /**
177
- * ArkEnv's main export, an alias for {@link createEnv}
178
- *
179
- * {@link https://arkenv.js.org | ArkEnv} is a typesafe environment variables validator from editor to runtime.
180
- */
181
- declare const arkenv: typeof createEnv;
182
- //#endregion
183
- export { type ArkEnvConfig, type EnvSchema, type Infer, createEnv, arkenv as default, type };
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AAA"}
package/dist/index.mjs DELETED
@@ -1,3 +0,0 @@
1
- import{n as e,r as t,t as n}from"./shared-B7lIFzfk.mjs";import{r,t as i}from"./core-B0IkKRzg.mjs";import{ArkErrors as a,scope as o,type as s}from"arktype";const c=s(`0 <= number.integer <= 65535`),l=s(`string.ip | 'localhost'`),u=o({string:s.module({...s.keywords.string,host:l}),number:s.module({...s.keywords.number,port:c})});function d(e){return Object.entries(e.byPath).map(([e,t])=>{let n=t.message,i=n.trimStart();if(i.length>0&&`:.-`.includes(i[0])&&(i=i.slice(1).trimStart()),i.toLowerCase().startsWith(e.toLowerCase())){let t=i.slice(e.length).trimStart();t.length>0&&`:.-`.includes(t[0])&&(t=t.slice(1)),n=t.trimStart()}let a=n.match(/\(was (.*)\)/);if(a?.[1]){let e=a[1];e.includes(`\x1B[`)||(n=n.replace(`(was ${e})`,`(was ${r(`cyan`,e)})`))}return{path:e,message:n}})}function f(r,o){let{env:s=process.env,coerce:c=!0,onUndeclaredKey:l=`delete`,arrayFormat:f=`comma`,emptyAsUndefined:p=!1}=o,m=(typeof r==`function`&&`assert`in r?r:u.type.raw(r)).onUndeclaredKey(l),h={...p?t(s):s};if(c){let t=e(m.in.toJsonSchema({fallback:e=>e.base}));t.length>0&&(h=n(h,t,{arrayFormat:f}))}let g=m(h);if(g instanceof a)throw new i(d(g));return g}function p(e,t={}){return f(e,t)}const m=u.type,h=p;export{p as createEnv,h as default,m as type};
2
-
3
- //# sourceMappingURL=index.mjs.map