@arrirpc/schema 0.55.0 → 0.57.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +62 -4
- package/dist/index.d.cts +8 -25
- package/dist/index.d.mts +8 -25
- package/dist/index.d.ts +8 -25
- package/dist/index.mjs +62 -5
- package/dist/shared/{schema.7414d46a.d.cts → schema.16e4d5ba.d.cts} +6 -5
- package/dist/shared/{schema.7414d46a.d.mts → schema.16e4d5ba.d.mts} +6 -5
- package/dist/shared/{schema.7414d46a.d.ts → schema.16e4d5ba.d.ts} +6 -5
- package/dist/shared/{schema.79ea38f8.mjs → schema.8f2f6fef.mjs} +114 -86
- package/dist/shared/{schema.4c9064ee.cjs → schema.e933693f.cjs} +113 -85
- package/dist/testSuites.cjs +1 -1
- package/dist/testSuites.d.cts +1 -1
- package/dist/testSuites.d.mts +1 -1
- package/dist/testSuites.d.ts +1 -1
- package/dist/testSuites.mjs +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const jtdUtils = require('jtd-utils');
|
|
4
4
|
const scule = require('scule');
|
|
5
|
-
const timestamp = require('./shared/schema.
|
|
5
|
+
const timestamp = require('./shared/schema.e933693f.cjs');
|
|
6
6
|
|
|
7
7
|
function createParsingTemplate(input, schema) {
|
|
8
8
|
const fallbackTemplate = `
|
|
@@ -2102,8 +2102,65 @@ const _namespace = {
|
|
|
2102
2102
|
validate: timestamp.validate
|
|
2103
2103
|
};
|
|
2104
2104
|
|
|
2105
|
-
function
|
|
2106
|
-
return
|
|
2105
|
+
function isAdaptedSchema(input) {
|
|
2106
|
+
return input.metadata[timestamp.SCHEMA_METADATA]._isAdapted === true;
|
|
2107
|
+
}
|
|
2108
|
+
function validatorFromAdaptedSchema(schema) {
|
|
2109
|
+
return {
|
|
2110
|
+
compiledCode: {
|
|
2111
|
+
parse: "",
|
|
2112
|
+
serialize: "",
|
|
2113
|
+
validate: ""
|
|
2114
|
+
},
|
|
2115
|
+
validate: schema.metadata[timestamp.SCHEMA_METADATA].validate,
|
|
2116
|
+
parse(input) {
|
|
2117
|
+
const context = {
|
|
2118
|
+
instancePath: "",
|
|
2119
|
+
schemaPath: "",
|
|
2120
|
+
errors: []
|
|
2121
|
+
};
|
|
2122
|
+
return schema.metadata[timestamp.SCHEMA_METADATA].parse(input, context);
|
|
2123
|
+
},
|
|
2124
|
+
safeParse(input) {
|
|
2125
|
+
const context = {
|
|
2126
|
+
instancePath: "",
|
|
2127
|
+
schemaPath: "",
|
|
2128
|
+
errors: []
|
|
2129
|
+
};
|
|
2130
|
+
try {
|
|
2131
|
+
const result = schema.metadata[timestamp.SCHEMA_METADATA].parse(
|
|
2132
|
+
input,
|
|
2133
|
+
context
|
|
2134
|
+
);
|
|
2135
|
+
return {
|
|
2136
|
+
success: true,
|
|
2137
|
+
value: result
|
|
2138
|
+
};
|
|
2139
|
+
} catch (err) {
|
|
2140
|
+
if (err instanceof timestamp.ValidationError) {
|
|
2141
|
+
return {
|
|
2142
|
+
success: false,
|
|
2143
|
+
error: err
|
|
2144
|
+
};
|
|
2145
|
+
}
|
|
2146
|
+
return {
|
|
2147
|
+
success: false,
|
|
2148
|
+
error: new timestamp.ValidationError({
|
|
2149
|
+
message: context.errors[0]?.message ?? `Error parsing input. ${err}`,
|
|
2150
|
+
errors: context.errors
|
|
2151
|
+
})
|
|
2152
|
+
};
|
|
2153
|
+
}
|
|
2154
|
+
},
|
|
2155
|
+
serialize(input) {
|
|
2156
|
+
const context = {
|
|
2157
|
+
instancePath: "",
|
|
2158
|
+
schemaPath: "",
|
|
2159
|
+
errors: []
|
|
2160
|
+
};
|
|
2161
|
+
return schema.metadata[timestamp.SCHEMA_METADATA].serialize(input, context);
|
|
2162
|
+
}
|
|
2163
|
+
};
|
|
2107
2164
|
}
|
|
2108
2165
|
|
|
2109
2166
|
exports.NumberTypeValues = timestamp.NumberTypeValues;
|
|
@@ -2183,4 +2240,5 @@ exports.getCompiledSerializer = getCompiledSerializer;
|
|
|
2183
2240
|
exports.getSchemaParsingCode = createParsingTemplate;
|
|
2184
2241
|
exports.getSchemaSerializationCode = createSerializationV2Template;
|
|
2185
2242
|
exports.getSchemaValidationCode = createValidationTemplate;
|
|
2186
|
-
exports.
|
|
2243
|
+
exports.isAdaptedSchema = isAdaptedSchema;
|
|
2244
|
+
exports.validatorFromAdaptedSchema = validatorFromAdaptedSchema;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as ASchema, I as InferType, S as SafeResult, a as ASchemaOptions, b as AArraySchema, c as AScalarSchema, d as AObjectSchema, e as ADiscriminatorSchema, R as ResolveObject, f as AStringEnumSchema, g as AObjectSchemaOptions, h as InferObjectOutput, V as
|
|
2
|
-
export { K as InferObjectRawType, M as MaybeNullable, D as NumberType, N as NumberTypeValues, P as PartialBy, B as Resolve, x as ValidationError,
|
|
1
|
+
import { A as ASchema, I as InferType, S as SafeResult, a as ASchemaOptions, b as AArraySchema, c as AScalarSchema, d as AObjectSchema, e as ADiscriminatorSchema, R as ResolveObject, f as AStringEnumSchema, g as AObjectSchemaOptions, h as InferObjectOutput, V as ValidationContext, i as ARecordSchema, j as ARefSchema, k as coerce, l as errors, m as InferSubType, p as parse, s as safeCoerce, n as safeParse, o as serialize, v as validate } from './shared/schema.16e4d5ba.cjs';
|
|
2
|
+
export { K as InferObjectRawType, M as MaybeNullable, D as NumberType, N as NumberTypeValues, P as PartialBy, B as Resolve, w as SCHEMA_METADATA, y as SchemaMetadata, x as SchemaValidator, t as ValidationError, r as ValueError, E as isAAraySchema, G as isADiscriminatorSchema, J as isAObjectSchema, H as isARecordSchema, O as isARefSchema, C as isAScalarSchema, z as isASchema, F as isAStringEnumSchema, L as isObject, u as isValidationError, q as sanitizeJson } from './shared/schema.16e4d5ba.cjs';
|
|
3
3
|
import { Schema } from 'jtd-utils';
|
|
4
4
|
|
|
5
5
|
declare function createParsingTemplate(input: string, schema: Schema): string;
|
|
@@ -189,7 +189,7 @@ declare function uint64(opts?: ASchemaOptions): AScalarSchema<"uint64", bigint>;
|
|
|
189
189
|
*/
|
|
190
190
|
declare function object<TInput extends Record<any, ASchema> = any, TAdditionalProps extends boolean = false>(input: TInput, opts?: AObjectSchemaOptions<TAdditionalProps>): AObjectSchema<InferObjectOutput<TInput, TAdditionalProps>, TAdditionalProps>;
|
|
191
191
|
declare function object<TInput extends Record<any, ASchema> = any, TAdditionalProps extends boolean = false>(id: string, input: TInput): AObjectSchema<InferObjectOutput<TInput, TAdditionalProps>, TAdditionalProps>;
|
|
192
|
-
declare function parseObjectSchema<T>(schema: AObjectSchema<T>, input: unknown, data:
|
|
192
|
+
declare function parseObjectSchema<T>(schema: AObjectSchema<T>, input: unknown, data: ValidationContext, coerce?: boolean): T | undefined;
|
|
193
193
|
declare function validateObjectSchema(schema: AObjectSchema, input: unknown): boolean;
|
|
194
194
|
/**
|
|
195
195
|
* Create an object schema using a subset of keys from another object schema
|
|
@@ -217,7 +217,7 @@ declare function pick<TSchema extends AObjectSchema<any, any> = any, TKeys exten
|
|
|
217
217
|
* const SubObject = a.omit(BaseObject, ['foo']) // { bar: string; baz: string; }
|
|
218
218
|
*/
|
|
219
219
|
declare function omit<TSchema extends AObjectSchema<any, any> = any, TKeys extends keyof InferType<TSchema> = any, TAdditionalProps extends boolean = false>(inputSchema: TSchema, keys: TKeys[], opts?: AObjectSchemaOptions<TAdditionalProps>): AObjectSchema<Omit<InferType<TSchema>, TKeys>, TAdditionalProps>;
|
|
220
|
-
declare function serializeObject(schema: AObjectSchema, input: any, data:
|
|
220
|
+
declare function serializeObject(schema: AObjectSchema, input: any, data: ValidationContext): string;
|
|
221
221
|
declare function extend<TBaseSchema extends AObjectSchema<any, any> = any, TSchema extends AObjectSchema<any, any> = any, TAdditionalProps extends boolean = false>(baseSchema: TBaseSchema, inputSchema: TSchema, opts?: AObjectSchemaOptions<TAdditionalProps>): AObjectSchema<ResolveObject<InferType<TBaseSchema> & InferType<TSchema>>, TAdditionalProps>;
|
|
222
222
|
declare function partial<TSchema extends AObjectSchema<any, any> = any, TAdditionalProps extends boolean = false>(schema: TSchema, options?: AObjectSchemaOptions<TAdditionalProps>): AObjectSchema<Partial<InferType<TSchema>>, TAdditionalProps>;
|
|
223
223
|
|
|
@@ -338,26 +338,9 @@ declare namespace _namespace {
|
|
|
338
338
|
export { _namespace_any as any, _namespace_array as array, _namespace_boolean as boolean, _namespace_clone as clone, _namespace_coerce as coerce, _namespace_compile as compile, _namespace_discriminator as discriminator, _namespace_enumerator as enumerator, _namespace_errors as errors, _namespace_extend as extend, _namespace_float32 as float32, _namespace_float64 as float64, InferType as infer, InferSubType as inferSubType, _namespace_int16 as int16, _namespace_int32 as int32, _namespace_int64 as int64, _namespace_int8 as int8, _namespace_nullable as nullable, _namespace_number as number, _namespace_object as object, _namespace_omit as omit, _namespace_optional as optional, _namespace_parse as parse, _namespace_partial as partial, _namespace_pick as pick, _namespace_record as record, _namespace_recursive as recursive, _namespace_safeCoerce as safeCoerce, _namespace_safeParse as safeParse, _namespace_serialize as serialize, _namespace_string as string, _namespace_stringEnum as stringEnum, _namespace_timestamp as timestamp, _namespace_uint16 as uint16, _namespace_uint32 as uint32, _namespace_uint64 as uint64, _namespace_uint8 as uint8, _namespace_validate as validate };
|
|
339
339
|
}
|
|
340
340
|
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
interface AAdaptedSchemaMetadata<T> extends SchemaMetadata<T> {
|
|
345
|
-
[SCHEMA_METADATA]: AAdaptedSchemaValidator<T>;
|
|
346
|
-
}
|
|
347
|
-
interface AAdaptedSchema<T> extends ASchema<T> {
|
|
348
|
-
metadata: AAdaptedSchemaMetadata<T>;
|
|
349
|
-
}
|
|
350
|
-
interface AAdaptedObjectSchema<T> extends AObjectSchema<T> {
|
|
351
|
-
metadata: AAdaptedSchemaMetadata<T>;
|
|
352
|
-
}
|
|
353
|
-
interface AAdaptedRecordSchema<T> extends ARecordSchema<ASchema<T>> {
|
|
354
|
-
metadata: AAdaptedSchemaMetadata<Record<string, T>>;
|
|
355
|
-
}
|
|
356
|
-
interface AAdaptedDiscriminatorSchema<T> extends ADiscriminatorSchema<T> {
|
|
357
|
-
metadata: AAdaptedSchemaMetadata<T>;
|
|
358
|
-
}
|
|
359
|
-
declare function isAAdaptedSchema<T = any>(input: unknown): input is AAdaptedSchema<T>;
|
|
360
|
-
type ValidationAdapter = <T>(input: any) => AAdaptedSchema<T>;
|
|
341
|
+
type ValidationAdapter = <T>(input: any) => ASchema<T>;
|
|
342
|
+
declare function isAdaptedSchema(input: ASchema): boolean;
|
|
343
|
+
declare function validatorFromAdaptedSchema(schema: ASchema): ReturnType<typeof compile>;
|
|
361
344
|
|
|
362
345
|
declare const int8Min = -128;
|
|
363
346
|
declare const int8Max = 127;
|
|
@@ -376,4 +359,4 @@ declare const int64Max: bigint;
|
|
|
376
359
|
declare const uint64Min: bigint;
|
|
377
360
|
declare const uint64Max: bigint;
|
|
378
361
|
|
|
379
|
-
export {
|
|
362
|
+
export { AArraySchema, ADiscriminatorSchema, AObjectSchema, AObjectSchemaOptions, ARecordSchema, ARefSchema, AScalarSchema, ASchema, ASchemaOptions, AStringEnumSchema, type CompiledValidator, InferObjectOutput, InferSubType, InferType, ResolveObject, SafeResult, type ValidationAdapter, ValidationContext, _namespace as a, any, array, boolean, clone, coerce, compile, discriminator, enumerator, errors, extend, float32, float64, getCompiledParser, getCompiledSerializer, createParsingTemplate as getSchemaParsingCode, createSerializationV2Template as getSchemaSerializationCode, createValidationTemplate as getSchemaValidationCode, int16, int16Max, int16Min, int32, int32Max, int32Min, int64, int64Max, int64Min, int8, int8Max, int8Min, isAdaptedSchema, nullable, number, object, omit, optional, parse, parseObjectSchema, partial, pick, record, recursive, safeCoerce, safeParse, serialize, serializeObject, serializeSmallString, string, stringEnum, timestamp, uint16, uint16Max, uint16Min, uint32, uint32Max, uint32Min, uint64, uint64Max, uint64Min, uint8, uint8Max, uint8Min, validate, validateObjectSchema, validatorFromAdaptedSchema };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as ASchema, I as InferType, S as SafeResult, a as ASchemaOptions, b as AArraySchema, c as AScalarSchema, d as AObjectSchema, e as ADiscriminatorSchema, R as ResolveObject, f as AStringEnumSchema, g as AObjectSchemaOptions, h as InferObjectOutput, V as
|
|
2
|
-
export { K as InferObjectRawType, M as MaybeNullable, D as NumberType, N as NumberTypeValues, P as PartialBy, B as Resolve, x as ValidationError,
|
|
1
|
+
import { A as ASchema, I as InferType, S as SafeResult, a as ASchemaOptions, b as AArraySchema, c as AScalarSchema, d as AObjectSchema, e as ADiscriminatorSchema, R as ResolveObject, f as AStringEnumSchema, g as AObjectSchemaOptions, h as InferObjectOutput, V as ValidationContext, i as ARecordSchema, j as ARefSchema, k as coerce, l as errors, m as InferSubType, p as parse, s as safeCoerce, n as safeParse, o as serialize, v as validate } from './shared/schema.16e4d5ba.mjs';
|
|
2
|
+
export { K as InferObjectRawType, M as MaybeNullable, D as NumberType, N as NumberTypeValues, P as PartialBy, B as Resolve, w as SCHEMA_METADATA, y as SchemaMetadata, x as SchemaValidator, t as ValidationError, r as ValueError, E as isAAraySchema, G as isADiscriminatorSchema, J as isAObjectSchema, H as isARecordSchema, O as isARefSchema, C as isAScalarSchema, z as isASchema, F as isAStringEnumSchema, L as isObject, u as isValidationError, q as sanitizeJson } from './shared/schema.16e4d5ba.mjs';
|
|
3
3
|
import { Schema } from 'jtd-utils';
|
|
4
4
|
|
|
5
5
|
declare function createParsingTemplate(input: string, schema: Schema): string;
|
|
@@ -189,7 +189,7 @@ declare function uint64(opts?: ASchemaOptions): AScalarSchema<"uint64", bigint>;
|
|
|
189
189
|
*/
|
|
190
190
|
declare function object<TInput extends Record<any, ASchema> = any, TAdditionalProps extends boolean = false>(input: TInput, opts?: AObjectSchemaOptions<TAdditionalProps>): AObjectSchema<InferObjectOutput<TInput, TAdditionalProps>, TAdditionalProps>;
|
|
191
191
|
declare function object<TInput extends Record<any, ASchema> = any, TAdditionalProps extends boolean = false>(id: string, input: TInput): AObjectSchema<InferObjectOutput<TInput, TAdditionalProps>, TAdditionalProps>;
|
|
192
|
-
declare function parseObjectSchema<T>(schema: AObjectSchema<T>, input: unknown, data:
|
|
192
|
+
declare function parseObjectSchema<T>(schema: AObjectSchema<T>, input: unknown, data: ValidationContext, coerce?: boolean): T | undefined;
|
|
193
193
|
declare function validateObjectSchema(schema: AObjectSchema, input: unknown): boolean;
|
|
194
194
|
/**
|
|
195
195
|
* Create an object schema using a subset of keys from another object schema
|
|
@@ -217,7 +217,7 @@ declare function pick<TSchema extends AObjectSchema<any, any> = any, TKeys exten
|
|
|
217
217
|
* const SubObject = a.omit(BaseObject, ['foo']) // { bar: string; baz: string; }
|
|
218
218
|
*/
|
|
219
219
|
declare function omit<TSchema extends AObjectSchema<any, any> = any, TKeys extends keyof InferType<TSchema> = any, TAdditionalProps extends boolean = false>(inputSchema: TSchema, keys: TKeys[], opts?: AObjectSchemaOptions<TAdditionalProps>): AObjectSchema<Omit<InferType<TSchema>, TKeys>, TAdditionalProps>;
|
|
220
|
-
declare function serializeObject(schema: AObjectSchema, input: any, data:
|
|
220
|
+
declare function serializeObject(schema: AObjectSchema, input: any, data: ValidationContext): string;
|
|
221
221
|
declare function extend<TBaseSchema extends AObjectSchema<any, any> = any, TSchema extends AObjectSchema<any, any> = any, TAdditionalProps extends boolean = false>(baseSchema: TBaseSchema, inputSchema: TSchema, opts?: AObjectSchemaOptions<TAdditionalProps>): AObjectSchema<ResolveObject<InferType<TBaseSchema> & InferType<TSchema>>, TAdditionalProps>;
|
|
222
222
|
declare function partial<TSchema extends AObjectSchema<any, any> = any, TAdditionalProps extends boolean = false>(schema: TSchema, options?: AObjectSchemaOptions<TAdditionalProps>): AObjectSchema<Partial<InferType<TSchema>>, TAdditionalProps>;
|
|
223
223
|
|
|
@@ -338,26 +338,9 @@ declare namespace _namespace {
|
|
|
338
338
|
export { _namespace_any as any, _namespace_array as array, _namespace_boolean as boolean, _namespace_clone as clone, _namespace_coerce as coerce, _namespace_compile as compile, _namespace_discriminator as discriminator, _namespace_enumerator as enumerator, _namespace_errors as errors, _namespace_extend as extend, _namespace_float32 as float32, _namespace_float64 as float64, InferType as infer, InferSubType as inferSubType, _namespace_int16 as int16, _namespace_int32 as int32, _namespace_int64 as int64, _namespace_int8 as int8, _namespace_nullable as nullable, _namespace_number as number, _namespace_object as object, _namespace_omit as omit, _namespace_optional as optional, _namespace_parse as parse, _namespace_partial as partial, _namespace_pick as pick, _namespace_record as record, _namespace_recursive as recursive, _namespace_safeCoerce as safeCoerce, _namespace_safeParse as safeParse, _namespace_serialize as serialize, _namespace_string as string, _namespace_stringEnum as stringEnum, _namespace_timestamp as timestamp, _namespace_uint16 as uint16, _namespace_uint32 as uint32, _namespace_uint64 as uint64, _namespace_uint8 as uint8, _namespace_validate as validate };
|
|
339
339
|
}
|
|
340
340
|
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
interface AAdaptedSchemaMetadata<T> extends SchemaMetadata<T> {
|
|
345
|
-
[SCHEMA_METADATA]: AAdaptedSchemaValidator<T>;
|
|
346
|
-
}
|
|
347
|
-
interface AAdaptedSchema<T> extends ASchema<T> {
|
|
348
|
-
metadata: AAdaptedSchemaMetadata<T>;
|
|
349
|
-
}
|
|
350
|
-
interface AAdaptedObjectSchema<T> extends AObjectSchema<T> {
|
|
351
|
-
metadata: AAdaptedSchemaMetadata<T>;
|
|
352
|
-
}
|
|
353
|
-
interface AAdaptedRecordSchema<T> extends ARecordSchema<ASchema<T>> {
|
|
354
|
-
metadata: AAdaptedSchemaMetadata<Record<string, T>>;
|
|
355
|
-
}
|
|
356
|
-
interface AAdaptedDiscriminatorSchema<T> extends ADiscriminatorSchema<T> {
|
|
357
|
-
metadata: AAdaptedSchemaMetadata<T>;
|
|
358
|
-
}
|
|
359
|
-
declare function isAAdaptedSchema<T = any>(input: unknown): input is AAdaptedSchema<T>;
|
|
360
|
-
type ValidationAdapter = <T>(input: any) => AAdaptedSchema<T>;
|
|
341
|
+
type ValidationAdapter = <T>(input: any) => ASchema<T>;
|
|
342
|
+
declare function isAdaptedSchema(input: ASchema): boolean;
|
|
343
|
+
declare function validatorFromAdaptedSchema(schema: ASchema): ReturnType<typeof compile>;
|
|
361
344
|
|
|
362
345
|
declare const int8Min = -128;
|
|
363
346
|
declare const int8Max = 127;
|
|
@@ -376,4 +359,4 @@ declare const int64Max: bigint;
|
|
|
376
359
|
declare const uint64Min: bigint;
|
|
377
360
|
declare const uint64Max: bigint;
|
|
378
361
|
|
|
379
|
-
export {
|
|
362
|
+
export { AArraySchema, ADiscriminatorSchema, AObjectSchema, AObjectSchemaOptions, ARecordSchema, ARefSchema, AScalarSchema, ASchema, ASchemaOptions, AStringEnumSchema, type CompiledValidator, InferObjectOutput, InferSubType, InferType, ResolveObject, SafeResult, type ValidationAdapter, ValidationContext, _namespace as a, any, array, boolean, clone, coerce, compile, discriminator, enumerator, errors, extend, float32, float64, getCompiledParser, getCompiledSerializer, createParsingTemplate as getSchemaParsingCode, createSerializationV2Template as getSchemaSerializationCode, createValidationTemplate as getSchemaValidationCode, int16, int16Max, int16Min, int32, int32Max, int32Min, int64, int64Max, int64Min, int8, int8Max, int8Min, isAdaptedSchema, nullable, number, object, omit, optional, parse, parseObjectSchema, partial, pick, record, recursive, safeCoerce, safeParse, serialize, serializeObject, serializeSmallString, string, stringEnum, timestamp, uint16, uint16Max, uint16Min, uint32, uint32Max, uint32Min, uint64, uint64Max, uint64Min, uint8, uint8Max, uint8Min, validate, validateObjectSchema, validatorFromAdaptedSchema };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as ASchema, I as InferType, S as SafeResult, a as ASchemaOptions, b as AArraySchema, c as AScalarSchema, d as AObjectSchema, e as ADiscriminatorSchema, R as ResolveObject, f as AStringEnumSchema, g as AObjectSchemaOptions, h as InferObjectOutput, V as
|
|
2
|
-
export { K as InferObjectRawType, M as MaybeNullable, D as NumberType, N as NumberTypeValues, P as PartialBy, B as Resolve, x as ValidationError,
|
|
1
|
+
import { A as ASchema, I as InferType, S as SafeResult, a as ASchemaOptions, b as AArraySchema, c as AScalarSchema, d as AObjectSchema, e as ADiscriminatorSchema, R as ResolveObject, f as AStringEnumSchema, g as AObjectSchemaOptions, h as InferObjectOutput, V as ValidationContext, i as ARecordSchema, j as ARefSchema, k as coerce, l as errors, m as InferSubType, p as parse, s as safeCoerce, n as safeParse, o as serialize, v as validate } from './shared/schema.16e4d5ba.js';
|
|
2
|
+
export { K as InferObjectRawType, M as MaybeNullable, D as NumberType, N as NumberTypeValues, P as PartialBy, B as Resolve, w as SCHEMA_METADATA, y as SchemaMetadata, x as SchemaValidator, t as ValidationError, r as ValueError, E as isAAraySchema, G as isADiscriminatorSchema, J as isAObjectSchema, H as isARecordSchema, O as isARefSchema, C as isAScalarSchema, z as isASchema, F as isAStringEnumSchema, L as isObject, u as isValidationError, q as sanitizeJson } from './shared/schema.16e4d5ba.js';
|
|
3
3
|
import { Schema } from 'jtd-utils';
|
|
4
4
|
|
|
5
5
|
declare function createParsingTemplate(input: string, schema: Schema): string;
|
|
@@ -189,7 +189,7 @@ declare function uint64(opts?: ASchemaOptions): AScalarSchema<"uint64", bigint>;
|
|
|
189
189
|
*/
|
|
190
190
|
declare function object<TInput extends Record<any, ASchema> = any, TAdditionalProps extends boolean = false>(input: TInput, opts?: AObjectSchemaOptions<TAdditionalProps>): AObjectSchema<InferObjectOutput<TInput, TAdditionalProps>, TAdditionalProps>;
|
|
191
191
|
declare function object<TInput extends Record<any, ASchema> = any, TAdditionalProps extends boolean = false>(id: string, input: TInput): AObjectSchema<InferObjectOutput<TInput, TAdditionalProps>, TAdditionalProps>;
|
|
192
|
-
declare function parseObjectSchema<T>(schema: AObjectSchema<T>, input: unknown, data:
|
|
192
|
+
declare function parseObjectSchema<T>(schema: AObjectSchema<T>, input: unknown, data: ValidationContext, coerce?: boolean): T | undefined;
|
|
193
193
|
declare function validateObjectSchema(schema: AObjectSchema, input: unknown): boolean;
|
|
194
194
|
/**
|
|
195
195
|
* Create an object schema using a subset of keys from another object schema
|
|
@@ -217,7 +217,7 @@ declare function pick<TSchema extends AObjectSchema<any, any> = any, TKeys exten
|
|
|
217
217
|
* const SubObject = a.omit(BaseObject, ['foo']) // { bar: string; baz: string; }
|
|
218
218
|
*/
|
|
219
219
|
declare function omit<TSchema extends AObjectSchema<any, any> = any, TKeys extends keyof InferType<TSchema> = any, TAdditionalProps extends boolean = false>(inputSchema: TSchema, keys: TKeys[], opts?: AObjectSchemaOptions<TAdditionalProps>): AObjectSchema<Omit<InferType<TSchema>, TKeys>, TAdditionalProps>;
|
|
220
|
-
declare function serializeObject(schema: AObjectSchema, input: any, data:
|
|
220
|
+
declare function serializeObject(schema: AObjectSchema, input: any, data: ValidationContext): string;
|
|
221
221
|
declare function extend<TBaseSchema extends AObjectSchema<any, any> = any, TSchema extends AObjectSchema<any, any> = any, TAdditionalProps extends boolean = false>(baseSchema: TBaseSchema, inputSchema: TSchema, opts?: AObjectSchemaOptions<TAdditionalProps>): AObjectSchema<ResolveObject<InferType<TBaseSchema> & InferType<TSchema>>, TAdditionalProps>;
|
|
222
222
|
declare function partial<TSchema extends AObjectSchema<any, any> = any, TAdditionalProps extends boolean = false>(schema: TSchema, options?: AObjectSchemaOptions<TAdditionalProps>): AObjectSchema<Partial<InferType<TSchema>>, TAdditionalProps>;
|
|
223
223
|
|
|
@@ -338,26 +338,9 @@ declare namespace _namespace {
|
|
|
338
338
|
export { _namespace_any as any, _namespace_array as array, _namespace_boolean as boolean, _namespace_clone as clone, _namespace_coerce as coerce, _namespace_compile as compile, _namespace_discriminator as discriminator, _namespace_enumerator as enumerator, _namespace_errors as errors, _namespace_extend as extend, _namespace_float32 as float32, _namespace_float64 as float64, InferType as infer, InferSubType as inferSubType, _namespace_int16 as int16, _namespace_int32 as int32, _namespace_int64 as int64, _namespace_int8 as int8, _namespace_nullable as nullable, _namespace_number as number, _namespace_object as object, _namespace_omit as omit, _namespace_optional as optional, _namespace_parse as parse, _namespace_partial as partial, _namespace_pick as pick, _namespace_record as record, _namespace_recursive as recursive, _namespace_safeCoerce as safeCoerce, _namespace_safeParse as safeParse, _namespace_serialize as serialize, _namespace_string as string, _namespace_stringEnum as stringEnum, _namespace_timestamp as timestamp, _namespace_uint16 as uint16, _namespace_uint32 as uint32, _namespace_uint64 as uint64, _namespace_uint8 as uint8, _namespace_validate as validate };
|
|
339
339
|
}
|
|
340
340
|
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
interface AAdaptedSchemaMetadata<T> extends SchemaMetadata<T> {
|
|
345
|
-
[SCHEMA_METADATA]: AAdaptedSchemaValidator<T>;
|
|
346
|
-
}
|
|
347
|
-
interface AAdaptedSchema<T> extends ASchema<T> {
|
|
348
|
-
metadata: AAdaptedSchemaMetadata<T>;
|
|
349
|
-
}
|
|
350
|
-
interface AAdaptedObjectSchema<T> extends AObjectSchema<T> {
|
|
351
|
-
metadata: AAdaptedSchemaMetadata<T>;
|
|
352
|
-
}
|
|
353
|
-
interface AAdaptedRecordSchema<T> extends ARecordSchema<ASchema<T>> {
|
|
354
|
-
metadata: AAdaptedSchemaMetadata<Record<string, T>>;
|
|
355
|
-
}
|
|
356
|
-
interface AAdaptedDiscriminatorSchema<T> extends ADiscriminatorSchema<T> {
|
|
357
|
-
metadata: AAdaptedSchemaMetadata<T>;
|
|
358
|
-
}
|
|
359
|
-
declare function isAAdaptedSchema<T = any>(input: unknown): input is AAdaptedSchema<T>;
|
|
360
|
-
type ValidationAdapter = <T>(input: any) => AAdaptedSchema<T>;
|
|
341
|
+
type ValidationAdapter = <T>(input: any) => ASchema<T>;
|
|
342
|
+
declare function isAdaptedSchema(input: ASchema): boolean;
|
|
343
|
+
declare function validatorFromAdaptedSchema(schema: ASchema): ReturnType<typeof compile>;
|
|
361
344
|
|
|
362
345
|
declare const int8Min = -128;
|
|
363
346
|
declare const int8Max = 127;
|
|
@@ -376,4 +359,4 @@ declare const int64Max: bigint;
|
|
|
376
359
|
declare const uint64Min: bigint;
|
|
377
360
|
declare const uint64Max: bigint;
|
|
378
361
|
|
|
379
|
-
export {
|
|
362
|
+
export { AArraySchema, ADiscriminatorSchema, AObjectSchema, AObjectSchemaOptions, ARecordSchema, ARefSchema, AScalarSchema, ASchema, ASchemaOptions, AStringEnumSchema, type CompiledValidator, InferObjectOutput, InferSubType, InferType, ResolveObject, SafeResult, type ValidationAdapter, ValidationContext, _namespace as a, any, array, boolean, clone, coerce, compile, discriminator, enumerator, errors, extend, float32, float64, getCompiledParser, getCompiledSerializer, createParsingTemplate as getSchemaParsingCode, createSerializationV2Template as getSchemaSerializationCode, createValidationTemplate as getSchemaValidationCode, int16, int16Max, int16Min, int32, int32Max, int32Min, int64, int64Max, int64Min, int8, int8Max, int8Min, isAdaptedSchema, nullable, number, object, omit, optional, parse, parseObjectSchema, partial, pick, record, recursive, safeCoerce, safeParse, serialize, serializeObject, serializeSmallString, string, stringEnum, timestamp, uint16, uint16Max, uint16Min, uint32, uint32Max, uint32Min, uint64, uint64Max, uint64Min, uint8, uint8Max, uint8Min, validate, validateObjectSchema, validatorFromAdaptedSchema };
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isSchemaFormProperties, isSchemaFormValues, isSchemaFormElements, isSchemaFormDiscriminator, isSchemaFormEmpty, isSchemaFormType, isSchemaFormEnum, isSchemaFormRef } from 'jtd-utils';
|
|
2
2
|
import { camelCase } from 'scule';
|
|
3
|
-
import { u as uint8Max, a as uint8Min, b as uint16Max, c as uint16Min, d as uint32Max, e as uint32Min, i as int8Max, f as int8Min, g as int16Max, h as int16Min, j as int32Max, k as int32Min, l as isAScalarSchema, m as isAObjectSchema, n as isAStringEnumSchema, o as isAAraySchema, p as isARecordSchema, q as isADiscriminatorSchema, r as isARefSchema, s as errors, V as ValidationError, t as any, v as array, w as boolean, x as clone, y as coerce, z as discriminator, A as enumerator, B as extend, C as float32, D as float64, E as int16, F as int32, G as int64, H as int8, I as nullable, J as number, K as object, L as omit, M as optional, N as parse, O as partial, P as pick, Q as record, R as recursive, S as safeCoerce, T as safeParse, U as serialize, W as string, X as stringEnum, Y as timestamp, Z as uint16, _ as uint32, $ as uint64, a0 as uint8, a1 as validate, a2 as
|
|
4
|
-
export { ae as NumberTypeValues,
|
|
3
|
+
import { u as uint8Max, a as uint8Min, b as uint16Max, c as uint16Min, d as uint32Max, e as uint32Min, i as int8Max, f as int8Min, g as int16Max, h as int16Min, j as int32Max, k as int32Min, l as isAScalarSchema, m as isAObjectSchema, n as isAStringEnumSchema, o as isAAraySchema, p as isARecordSchema, q as isADiscriminatorSchema, r as isARefSchema, s as errors, V as ValidationError, t as any, v as array, w as boolean, x as clone, y as coerce, z as discriminator, A as enumerator, B as extend, C as float32, D as float64, E as int16, F as int32, G as int64, H as int8, I as nullable, J as number, K as object, L as omit, M as optional, N as parse, O as partial, P as pick, Q as record, R as recursive, S as safeCoerce, T as safeParse, U as serialize, W as string, X as stringEnum, Y as timestamp, Z as uint16, _ as uint32, $ as uint64, a0 as uint8, a1 as validate, a2 as SCHEMA_METADATA } from './shared/schema.8f2f6fef.mjs';
|
|
4
|
+
export { ae as NumberTypeValues, a4 as int64Max, a3 as int64Min, ad as isASchema, af as isObject, ac as isValidationError, a7 as parseObjectSchema, ab as sanitizeJson, a9 as serializeObject, aa as serializeSmallString, a6 as uint64Max, a5 as uint64Min, a8 as validateObjectSchema } from './shared/schema.8f2f6fef.mjs';
|
|
5
5
|
|
|
6
6
|
function createParsingTemplate(input, schema) {
|
|
7
7
|
const fallbackTemplate = `
|
|
@@ -2101,8 +2101,65 @@ const _namespace = {
|
|
|
2101
2101
|
validate: validate
|
|
2102
2102
|
};
|
|
2103
2103
|
|
|
2104
|
-
function
|
|
2105
|
-
return
|
|
2104
|
+
function isAdaptedSchema(input) {
|
|
2105
|
+
return input.metadata[SCHEMA_METADATA]._isAdapted === true;
|
|
2106
|
+
}
|
|
2107
|
+
function validatorFromAdaptedSchema(schema) {
|
|
2108
|
+
return {
|
|
2109
|
+
compiledCode: {
|
|
2110
|
+
parse: "",
|
|
2111
|
+
serialize: "",
|
|
2112
|
+
validate: ""
|
|
2113
|
+
},
|
|
2114
|
+
validate: schema.metadata[SCHEMA_METADATA].validate,
|
|
2115
|
+
parse(input) {
|
|
2116
|
+
const context = {
|
|
2117
|
+
instancePath: "",
|
|
2118
|
+
schemaPath: "",
|
|
2119
|
+
errors: []
|
|
2120
|
+
};
|
|
2121
|
+
return schema.metadata[SCHEMA_METADATA].parse(input, context);
|
|
2122
|
+
},
|
|
2123
|
+
safeParse(input) {
|
|
2124
|
+
const context = {
|
|
2125
|
+
instancePath: "",
|
|
2126
|
+
schemaPath: "",
|
|
2127
|
+
errors: []
|
|
2128
|
+
};
|
|
2129
|
+
try {
|
|
2130
|
+
const result = schema.metadata[SCHEMA_METADATA].parse(
|
|
2131
|
+
input,
|
|
2132
|
+
context
|
|
2133
|
+
);
|
|
2134
|
+
return {
|
|
2135
|
+
success: true,
|
|
2136
|
+
value: result
|
|
2137
|
+
};
|
|
2138
|
+
} catch (err) {
|
|
2139
|
+
if (err instanceof ValidationError) {
|
|
2140
|
+
return {
|
|
2141
|
+
success: false,
|
|
2142
|
+
error: err
|
|
2143
|
+
};
|
|
2144
|
+
}
|
|
2145
|
+
return {
|
|
2146
|
+
success: false,
|
|
2147
|
+
error: new ValidationError({
|
|
2148
|
+
message: context.errors[0]?.message ?? `Error parsing input. ${err}`,
|
|
2149
|
+
errors: context.errors
|
|
2150
|
+
})
|
|
2151
|
+
};
|
|
2152
|
+
}
|
|
2153
|
+
},
|
|
2154
|
+
serialize(input) {
|
|
2155
|
+
const context = {
|
|
2156
|
+
instancePath: "",
|
|
2157
|
+
schemaPath: "",
|
|
2158
|
+
errors: []
|
|
2159
|
+
};
|
|
2160
|
+
return schema.metadata[SCHEMA_METADATA].serialize(input, context);
|
|
2161
|
+
}
|
|
2162
|
+
};
|
|
2106
2163
|
}
|
|
2107
2164
|
|
|
2108
|
-
export { SCHEMA_METADATA, ValidationError, _namespace as a, any, array, boolean, clone, coerce, compile, discriminator, enumerator, errors, extend, float32, float64, getCompiledParser, getCompiledSerializer, createParsingTemplate as getSchemaParsingCode, createSerializationV2Template as getSchemaSerializationCode, createValidationTemplate as getSchemaValidationCode, int16, int16Max, int16Min, int32, int32Max, int32Min, int64, int8, int8Max, int8Min,
|
|
2165
|
+
export { SCHEMA_METADATA, ValidationError, _namespace as a, any, array, boolean, clone, coerce, compile, discriminator, enumerator, errors, extend, float32, float64, getCompiledParser, getCompiledSerializer, createParsingTemplate as getSchemaParsingCode, createSerializationV2Template as getSchemaSerializationCode, createValidationTemplate as getSchemaValidationCode, int16, int16Max, int16Min, int32, int32Max, int32Min, int64, int8, int8Max, int8Min, isAAraySchema, isADiscriminatorSchema, isAObjectSchema, isARecordSchema, isARefSchema, isAScalarSchema, isAStringEnumSchema, isAdaptedSchema, nullable, number, object, omit, optional, parse, partial, pick, record, recursive, safeCoerce, safeParse, serialize, string, stringEnum, timestamp, uint16, uint16Max, uint16Min, uint32, uint32Max, uint32Min, uint64, uint8, uint8Max, uint8Min, validate, validatorFromAdaptedSchema };
|
|
@@ -50,7 +50,7 @@ declare function isValidationError(input: unknown): input is ValidationError;
|
|
|
50
50
|
|
|
51
51
|
declare const SCHEMA_METADATA: unique symbol;
|
|
52
52
|
type MaybeNullable<T = any, TIsNullable extends boolean = false> = TIsNullable extends true ? T | null : T;
|
|
53
|
-
interface
|
|
53
|
+
interface ValidationContext {
|
|
54
54
|
instancePath: string;
|
|
55
55
|
schemaPath: string;
|
|
56
56
|
errors: ValueError[];
|
|
@@ -60,10 +60,11 @@ interface ValidationData {
|
|
|
60
60
|
interface SchemaValidator<T> {
|
|
61
61
|
output: T;
|
|
62
62
|
optional?: boolean;
|
|
63
|
-
parse: (input: unknown,
|
|
64
|
-
coerce: (input: unknown,
|
|
65
|
-
serialize: (input: T,
|
|
63
|
+
parse: (input: unknown, context: ValidationContext) => T | undefined;
|
|
64
|
+
coerce: (input: unknown, context: ValidationContext) => T | undefined;
|
|
65
|
+
serialize: (input: T, context: ValidationContext) => string;
|
|
66
66
|
validate: (input: unknown) => input is T;
|
|
67
|
+
_isAdapted?: boolean;
|
|
67
68
|
}
|
|
68
69
|
interface SchemaMetadata<T> {
|
|
69
70
|
[key: string]: any;
|
|
@@ -164,4 +165,4 @@ interface ARefSchema<T> extends ASchema<T> {
|
|
|
164
165
|
}
|
|
165
166
|
declare function isARefSchema(input: unknown): input is ARefSchema<any>;
|
|
166
167
|
|
|
167
|
-
export { type ASchema as A, type Resolve as B, isAScalarSchema as C, type NumberType as D, isAAraySchema as E, isAStringEnumSchema as F, isADiscriminatorSchema as G, isARecordSchema as H, type InferType as I, isAObjectSchema as J, type InferObjectRawType as K, isObject as L, type MaybeNullable as M, NumberTypeValues as N, isARefSchema as O, type PartialBy as P, type ResolveObject as R, type SafeResult as S, type
|
|
168
|
+
export { type ASchema as A, type Resolve as B, isAScalarSchema as C, type NumberType as D, isAAraySchema as E, isAStringEnumSchema as F, isADiscriminatorSchema as G, isARecordSchema as H, type InferType as I, isAObjectSchema as J, type InferObjectRawType as K, isObject as L, type MaybeNullable as M, NumberTypeValues as N, isARefSchema as O, type PartialBy as P, type ResolveObject as R, type SafeResult as S, type ValidationContext as V, type ASchemaOptions as a, type AArraySchema as b, type AScalarSchema as c, type AObjectSchema as d, type ADiscriminatorSchema as e, type AStringEnumSchema as f, type AObjectSchemaOptions as g, type InferObjectOutput as h, type ARecordSchema as i, type ARefSchema as j, coerce as k, errors as l, type InferSubType as m, safeParse as n, serialize as o, parse as p, sanitizeJson as q, type ValueError as r, safeCoerce as s, ValidationError as t, isValidationError as u, validate as v, SCHEMA_METADATA as w, type SchemaValidator as x, type SchemaMetadata as y, isASchema as z };
|
|
@@ -50,7 +50,7 @@ declare function isValidationError(input: unknown): input is ValidationError;
|
|
|
50
50
|
|
|
51
51
|
declare const SCHEMA_METADATA: unique symbol;
|
|
52
52
|
type MaybeNullable<T = any, TIsNullable extends boolean = false> = TIsNullable extends true ? T | null : T;
|
|
53
|
-
interface
|
|
53
|
+
interface ValidationContext {
|
|
54
54
|
instancePath: string;
|
|
55
55
|
schemaPath: string;
|
|
56
56
|
errors: ValueError[];
|
|
@@ -60,10 +60,11 @@ interface ValidationData {
|
|
|
60
60
|
interface SchemaValidator<T> {
|
|
61
61
|
output: T;
|
|
62
62
|
optional?: boolean;
|
|
63
|
-
parse: (input: unknown,
|
|
64
|
-
coerce: (input: unknown,
|
|
65
|
-
serialize: (input: T,
|
|
63
|
+
parse: (input: unknown, context: ValidationContext) => T | undefined;
|
|
64
|
+
coerce: (input: unknown, context: ValidationContext) => T | undefined;
|
|
65
|
+
serialize: (input: T, context: ValidationContext) => string;
|
|
66
66
|
validate: (input: unknown) => input is T;
|
|
67
|
+
_isAdapted?: boolean;
|
|
67
68
|
}
|
|
68
69
|
interface SchemaMetadata<T> {
|
|
69
70
|
[key: string]: any;
|
|
@@ -164,4 +165,4 @@ interface ARefSchema<T> extends ASchema<T> {
|
|
|
164
165
|
}
|
|
165
166
|
declare function isARefSchema(input: unknown): input is ARefSchema<any>;
|
|
166
167
|
|
|
167
|
-
export { type ASchema as A, type Resolve as B, isAScalarSchema as C, type NumberType as D, isAAraySchema as E, isAStringEnumSchema as F, isADiscriminatorSchema as G, isARecordSchema as H, type InferType as I, isAObjectSchema as J, type InferObjectRawType as K, isObject as L, type MaybeNullable as M, NumberTypeValues as N, isARefSchema as O, type PartialBy as P, type ResolveObject as R, type SafeResult as S, type
|
|
168
|
+
export { type ASchema as A, type Resolve as B, isAScalarSchema as C, type NumberType as D, isAAraySchema as E, isAStringEnumSchema as F, isADiscriminatorSchema as G, isARecordSchema as H, type InferType as I, isAObjectSchema as J, type InferObjectRawType as K, isObject as L, type MaybeNullable as M, NumberTypeValues as N, isARefSchema as O, type PartialBy as P, type ResolveObject as R, type SafeResult as S, type ValidationContext as V, type ASchemaOptions as a, type AArraySchema as b, type AScalarSchema as c, type AObjectSchema as d, type ADiscriminatorSchema as e, type AStringEnumSchema as f, type AObjectSchemaOptions as g, type InferObjectOutput as h, type ARecordSchema as i, type ARefSchema as j, coerce as k, errors as l, type InferSubType as m, safeParse as n, serialize as o, parse as p, sanitizeJson as q, type ValueError as r, safeCoerce as s, ValidationError as t, isValidationError as u, validate as v, SCHEMA_METADATA as w, type SchemaValidator as x, type SchemaMetadata as y, isASchema as z };
|
|
@@ -50,7 +50,7 @@ declare function isValidationError(input: unknown): input is ValidationError;
|
|
|
50
50
|
|
|
51
51
|
declare const SCHEMA_METADATA: unique symbol;
|
|
52
52
|
type MaybeNullable<T = any, TIsNullable extends boolean = false> = TIsNullable extends true ? T | null : T;
|
|
53
|
-
interface
|
|
53
|
+
interface ValidationContext {
|
|
54
54
|
instancePath: string;
|
|
55
55
|
schemaPath: string;
|
|
56
56
|
errors: ValueError[];
|
|
@@ -60,10 +60,11 @@ interface ValidationData {
|
|
|
60
60
|
interface SchemaValidator<T> {
|
|
61
61
|
output: T;
|
|
62
62
|
optional?: boolean;
|
|
63
|
-
parse: (input: unknown,
|
|
64
|
-
coerce: (input: unknown,
|
|
65
|
-
serialize: (input: T,
|
|
63
|
+
parse: (input: unknown, context: ValidationContext) => T | undefined;
|
|
64
|
+
coerce: (input: unknown, context: ValidationContext) => T | undefined;
|
|
65
|
+
serialize: (input: T, context: ValidationContext) => string;
|
|
66
66
|
validate: (input: unknown) => input is T;
|
|
67
|
+
_isAdapted?: boolean;
|
|
67
68
|
}
|
|
68
69
|
interface SchemaMetadata<T> {
|
|
69
70
|
[key: string]: any;
|
|
@@ -164,4 +165,4 @@ interface ARefSchema<T> extends ASchema<T> {
|
|
|
164
165
|
}
|
|
165
166
|
declare function isARefSchema(input: unknown): input is ARefSchema<any>;
|
|
166
167
|
|
|
167
|
-
export { type ASchema as A, type Resolve as B, isAScalarSchema as C, type NumberType as D, isAAraySchema as E, isAStringEnumSchema as F, isADiscriminatorSchema as G, isARecordSchema as H, type InferType as I, isAObjectSchema as J, type InferObjectRawType as K, isObject as L, type MaybeNullable as M, NumberTypeValues as N, isARefSchema as O, type PartialBy as P, type ResolveObject as R, type SafeResult as S, type
|
|
168
|
+
export { type ASchema as A, type Resolve as B, isAScalarSchema as C, type NumberType as D, isAAraySchema as E, isAStringEnumSchema as F, isADiscriminatorSchema as G, isARecordSchema as H, type InferType as I, isAObjectSchema as J, type InferObjectRawType as K, isObject as L, type MaybeNullable as M, NumberTypeValues as N, isARefSchema as O, type PartialBy as P, type ResolveObject as R, type SafeResult as S, type ValidationContext as V, type ASchemaOptions as a, type AArraySchema as b, type AScalarSchema as c, type AObjectSchema as d, type ADiscriminatorSchema as e, type AStringEnumSchema as f, type AObjectSchemaOptions as g, type InferObjectOutput as h, type ARecordSchema as i, type ARefSchema as j, coerce as k, errors as l, type InferSubType as m, safeParse as n, serialize as o, parse as p, sanitizeJson as q, type ValueError as r, safeCoerce as s, ValidationError as t, isValidationError as u, validate as v, SCHEMA_METADATA as w, type SchemaValidator as x, type SchemaMetadata as y, isASchema as z };
|