arkenv 1.0.0-alpha.2 → 1.0.0-alpha.21

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,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: Dict<string>) => 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-Do-2CL1V.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-Do-2CL1V.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","Dict","StandardSchemaV1","InferType","T","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,IAAA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A,gBAA2Bb,eAAAA,IAAmBA,eAAAA,CAAgBa,WAAAA,CAAYT,MAAAA;AAAAA;;;;;;AF9EC;;;;;;KGUxEqC,SAAAA,MAAeC,CAAAA,SAAUF,gBAAAA,+BAA+CM,MAAAA,GAASJ,CAAAA,WAAWK,KAAAA,EAAOR,IAAAA,wBAA2BS,CAAAA,SAAUV,IAAAA,CAAKK,MAAAA,WAAiBK,CAAAA,GAAIN,CAAAA;EAC1KO,CAAAA;AAAAA,IACAC,CAAAA,GAAIR,CAAAA,SAAUJ,IAAAA,CAAKM,GAAAA,0BAA6BM,CAAAA;;;KCZxCI,WAAAA,GAAcC,MAAAA;;;;AJA0D;;;;;;;;;KIaxEC,iBAAAA,GAAoBH,IAAAA,CAAKC,WAAAA,EAAaF,CAAAA"}
@@ -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: Dict<string>) => 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-NbQAnciD.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-NbQAnciD.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","Dict","StandardSchemaV1","InferType","T","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;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AAAA,EAAKT,WAAAA;EAAAA;EFlDVtE;EAAAA,UEqDEoD,KAAAA,2BAAgCJ,KAAAA,UAAeD,eAAAA,CAAgBK,KAAAA,CAAMJ,KAAAA,EAAOC,MAAAA;EFnDpFlC;EAAAA,KEsDG4C,UAAAA,gBAA0BZ,eAAAA,IAAmBA,eAAAA,CAAgBY,UAAAA,CAAWR,MAAAA;EFlD7E3C;EAAAA,KEoDKoD,WAAAA,gBAA2Bb,eAAAA,IAAmBA,eAAAA,CAAgBa,WAAAA,CAAYT,MAAAA;AAAAA;;;;;;AF9EC;;;;;;KGUxEqC,SAAAA,MAAeC,CAAAA,SAAUF,gBAAAA,+BAA+CM,MAAAA,GAASJ,CAAAA,WAAWK,KAAAA,EAAOR,IAAAA,wBAA2BS,CAAAA,SAAUV,IAAAA,CAAKK,MAAAA,WAAiBK,CAAAA,GAAIN,CAAAA;EAC1KO,CAAAA;AAAAA,IACAC,CAAAA,GAAIR,CAAAA,SAAUJ,IAAAA,CAAKM,GAAAA,0BAA6BM,CAAAA;;;KCZxCI,WAAAA,GAAcC,MAAAA;;;;AJA0D;;;;;;;;;KIaxEC,iBAAAA,GAAoBH,IAAAA,CAAKC,WAAAA,EAAaF,CAAAA"}
package/dist/index.cjs DELETED
@@ -1,8 +0,0 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`./errors-Dn6WQ2pP.cjs`),t=require(`./core-CA13n2Iu.cjs`);let n=require(`arktype`);const r=(0,n.type)(`0 <= number.integer <= 65535`),i=(0,n.type)(`string.ip | 'localhost'`),a=(0,n.scope)({string:n.type.module({...n.type.keywords.string,host:i}),number:n.type.module({...n.type.keywords.number,port:r})});function o(t,n){return Object.entries(t.byPath).map(([t,r])=>{let i=r.message,a=i.trimStart();if(a.length>0&&`:.-`.includes(a[0])&&(a=a.slice(1).trimStart()),a.toLowerCase().startsWith(t.toLowerCase())){let e=a.slice(t.length).trimStart();e.length>0&&`:.-`.includes(e[0])&&(e=e.slice(1)),i=e.trimStart()}i=e.s(i,t,n?.debugSecrets);let o=e.a(r.code),s={...e.r(r)};return e.t(t,i,o,s,r.expected,r.code===`required`?void 0:r.data)})}function s(r,i){let{env:s=process.env,coerce:c=!0,onUndeclaredKey:l=`delete`,arrayFormat:u=`comma`,emptyAsUndefined:d=!1}=i,f=(typeof r==`function`&&`assert`in r?r:a.type.raw(r)).onUndeclaredKey(l),{coercedEnv:p}=e.l(s,d,u,c?()=>({schema:f.in.toJsonSchema({fallback:e=>e.base}),hasSchema:!0}):void 0),m=f(p);if(m instanceof n.ArkErrors)throw new t.t(o(m,i));return m}function c(t,n={}){return n.safe?e.c(()=>s(t,n)):s(t,n)}function l(e){if(!e||typeof e!=`object`&&typeof e!=`function`)return[];if(e.json&&typeof e.json==`object`&&e.json.domain===`object`){let t=[];if(Array.isArray(e.json.required))for(let n of e.json.required)n&&typeof n==`object`&&`key`in n&&t.push(n.key);if(Array.isArray(e.json.optional))for(let n of e.json.optional)n&&typeof n==`object`&&`key`in n&&t.push(n.key);return t}let t=e[`~standard`],n=typeof t?.jsonSchema?.input==`function`&&t.jsonSchema.input||typeof e.jsonSchema?.input==`function`&&e.jsonSchema.input;if(n)try{let e=n({target:`draft-07`});if(e&&typeof e==`object`&&e.properties)return Object.keys(e.properties)}catch{}if(typeof e.toJSONSchema==`function`)try{let t=e.toJSONSchema();if(t&&typeof t==`object`&&t.properties)return Object.keys(t.properties)}catch{}if(typeof e.toStandardJSONSchema?.v1==`function`)try{let t=e.toStandardJSONSchema.v1();if(t&&typeof t==`object`&&t.properties)return Object.keys(t.properties)}catch{}return Object.keys(e)}const u=a.type;var d=c;exports.arkenv=c,exports.default=d,exports.getSchemaKeys=l,exports.type=u;
2
-
3
- // CJS Interop Shim
4
- if (module.exports && module.exports.default) {
5
- Object.assign(module.exports.default, module.exports);
6
- module.exports = module.exports.default;
7
- }
8
-