@vielzeug/spell 26.10.0 → 26.10.1

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 +1 @@
1
- {"version":3,"file":"types.cjs","names":[],"sources":["../src/types.ts"],"sourcesContent":["/* -------------------- Error Codes -------------------- */\n\nexport const ErrorCode = {\n custom: 'custom',\n invalid_base64: 'invalid_base64',\n invalid_date: 'invalid_date',\n invalid_duration: 'invalid_duration',\n invalid_enum: 'invalid_enum',\n invalid_finite: 'invalid_finite',\n invalid_integer: 'invalid_integer',\n invalid_keys: 'invalid_keys',\n invalid_length: 'invalid_length',\n invalid_literal: 'invalid_literal',\n invalid_multiple_of: 'invalid_multiple_of',\n invalid_safe: 'invalid_safe',\n invalid_string: 'invalid_string',\n invalid_type: 'invalid_type',\n invalid_union: 'invalid_union',\n invalid_unique: 'invalid_unique',\n invalid_url: 'invalid_url',\n invalid_variant: 'invalid_variant',\n too_big: 'too_big',\n too_small: 'too_small',\n} as const;\n\nexport type ErrorCode = (typeof ErrorCode)[keyof typeof ErrorCode];\n\n/* -------------------- Messages -------------------- */\n\n/**\n * A validation message — either a static string or a function that receives context and returns a string.\n * **Note:** Static string values are used verbatim with no interpolation. Use the function form\n * for context-dependent messages (e.g. `(ctx) => \\`Must be at least ${ctx.min}\\``).\n */\nexport type MessageFn<Ctx extends Record<string, unknown> = Record<string, unknown>> = string | ((ctx: Ctx) => string);\n\n/* -------------------- JSON Schema -------------------- */\n\n/** Plain JSON Schema object (targeting JSON Schema 2020-12). */\nexport type JsonSchema = Record<string, unknown>;\n\nexport interface StandardSchemaV1<Input = unknown, Output = Input> {\n readonly '~standard': StandardSchemaV1.Props<Input, Output>;\n}\n\nexport declare namespace StandardSchemaV1 {\n interface Props<Input = unknown, Output = Input> {\n readonly types?: Types<Input, Output> | undefined;\n readonly validate: (value: unknown, options?: Options | undefined) => Result<Output> | Promise<Result<Output>>;\n readonly vendor: string;\n readonly version: 1;\n }\n\n type Result<Output> = { readonly issues: readonly Issue[] } | { readonly issues?: undefined; readonly value: Output };\n\n interface Options {\n readonly libraryOptions?: Record<string, unknown> | undefined;\n }\n\n interface Issue {\n readonly message: string;\n readonly path?: readonly (PropertyKey | PathSegment)[] | undefined;\n }\n\n interface PathSegment {\n readonly key: PropertyKey;\n }\n\n interface Types<Input = unknown, Output = Input> {\n readonly input: Input;\n readonly output: Output;\n }\n\n type InferInput<Schema extends StandardSchemaV1> = NonNullable<Schema['~standard']['types']>['input'];\n type InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema['~standard']['types']>['output'];\n}\n\n/* -------------------- Issues -------------------- */\n\n/**\n * A typed discriminated union of all issues emitted by built-in validators.\n *\n * Narrowing on `code` gives precise access to `params`:\n * ```ts\n * if (error.code === 'too_small') {\n * const min = error.params.min; // number | bigint | Date\n * }\n * ```\n */\nexport type Issue =\n | { code: 'custom'; message: string; params?: Record<string, unknown>; path: (string | number)[] }\n | { code: 'invalid_base64'; message: string; params: { format: string }; path: (string | number)[] }\n | { code: 'invalid_date'; message: string; params?: undefined; path: (string | number)[] }\n | { code: 'invalid_duration'; message: string; params: { format: string }; path: (string | number)[] }\n | { code: 'invalid_enum'; message: string; params: { values: readonly unknown[] }; path: (string | number)[] }\n | { code: 'invalid_finite'; message: string; params?: undefined; path: (string | number)[] }\n | { code: 'invalid_integer'; message: string; params?: undefined; path: (string | number)[] }\n | { code: 'invalid_keys'; message: string; params: { keys: string[] }; path: (string | number)[] }\n | { code: 'invalid_length'; message: string; params: { exact: number }; path: (string | number)[] }\n | { code: 'invalid_literal'; message: string; params: { expected: unknown }; path: (string | number)[] }\n | { code: 'invalid_multiple_of'; message: string; params: { step: number | bigint }; path: (string | number)[] }\n | { code: 'invalid_safe'; message: string; params?: undefined; path: (string | number)[] }\n | {\n code: 'invalid_string';\n message: string;\n params: { format?: string; includes?: string; pattern?: string; prefix?: string; suffix?: string };\n path: (string | number)[];\n }\n | { code: 'invalid_type'; message: string; params?: undefined; path: (string | number)[] }\n | { code: 'invalid_union'; message: string; params: { errors: Issue[][] }; path: (string | number)[] }\n | { code: 'invalid_unique'; message: string; params: { unique: true }; path: (string | number)[] }\n | { code: 'invalid_url'; message: string; params: { format: string }; path: (string | number)[] }\n | {\n code: 'invalid_variant';\n message: string;\n params: { discriminator: string; expected: string[] };\n path: (string | number)[];\n }\n | {\n code: 'too_big';\n message: string;\n params: { exclusive?: boolean; max: number | bigint | Date };\n path: (string | number)[];\n }\n | {\n code: 'too_small';\n message: string;\n params: { exclusive?: boolean; min: number | bigint | Date };\n path: (string | number)[];\n }\n | { code: string & {}; message: string; params?: Record<string, unknown>; path: (string | number)[] };\n\n/** ParseContext carries the active message set through the parse pipeline. */\nexport type ParseContext = {\n messages: import('./messages').Messages;\n};\n\n/**\n * Validator function. Receives the value after type-checking and the active ParseContext.\n * Returns an Issue array on failure, null on success, or a Promise for async validators.\n */\nexport type ValidateFn = (value: unknown, ctx?: ParseContext) => Issue[] | null | Promise<Issue[] | null>;\n\nexport type CheckContext = {\n addIssue: (issue: {\n code: string;\n message: string;\n params?: Record<string, unknown>;\n path?: (string | number)[];\n }) => void;\n};\n\n/**\n * Return type of a `check()` callback.\n * - `string` — validation failed; the string becomes the error message.\n * - `false` — validation failed with no message (use `addIssue` for a message).\n * - `true` / `null` / `void` — validation passed.\n *\n * The shorthand `condition || 'message'` works naturally:\n * ```ts\n * s.string().check((value) => value.length > 0 || 'Cannot be empty')\n * ```\n */\nexport type ValidateResult = boolean | null | undefined | string;\n\n/** Re-exported from errors for convenience — defined there. */\nexport type { FlatError, FlatErrorFirst } from './errors';\n\ntype BaseDescriptor = {\n description?: string;\n isNullable?: boolean;\n isOptional?: boolean;\n};\n\nexport type SchemaDescriptor = BaseDescriptor &\n (\n | { kind: 'unknown' | 'never' | 'boolean' | 'bigint' | 'date' | 'lazy' }\n | { className: string; kind: 'instanceof' }\n | {\n contentEncoding?: string;\n format?: string;\n kind: 'string';\n maxLength?: number;\n minLength?: number;\n pattern?: string | null;\n }\n | {\n exclusiveMaximum?: number;\n exclusiveMinimum?: number;\n kind: 'number';\n maximum?: number;\n minimum?: number;\n multipleOf?: number;\n typeHint?: 'integer';\n }\n | { kind: 'literal'; value: string | number | boolean | null | undefined }\n | { kind: 'enum'; values: readonly (string | number)[] }\n | { items: SchemaDescriptor; kind: 'array'; maxItems?: number; minItems?: number }\n | { items: SchemaDescriptor[]; kind: 'tuple'; rest: SchemaDescriptor | null }\n | { fields: Record<string, SchemaDescriptor>; kind: 'object'; strict: boolean }\n | { key: SchemaDescriptor; kind: 'record'; value: SchemaDescriptor }\n | { items: SchemaDescriptor; kind: 'set' }\n | { key: SchemaDescriptor; kind: 'map'; value: SchemaDescriptor }\n | { branches: SchemaDescriptor[]; kind: 'union' | 'intersect' }\n | { branches: Record<string, SchemaDescriptor>; discriminator: string; kind: 'variant' }\n | { from: SchemaDescriptor; kind: 'pipe'; to: SchemaDescriptor }\n );\n\n/* -------------------- ParseResult (forward-references SpellValidationError) -------------------- */\n\nimport type { Schema } from './core';\n// Import only the type to avoid circular dependencies\nimport type { SpellValidationError } from './errors';\n\nexport type ParseResult<T> = { data: T; success: true } | { error: SpellValidationError; success: false };\n\n/* -------------------- Schema execution mode / Infer (forward-references Schema) -------------------- */\n\n/** Structural marker for a schema's input type. Emitted so public types can key on it. */\nexport const schemaInput = Symbol('spell.schemaInput');\n/** Structural marker for a schema's output type. Emitted so public types can key on it. */\nexport const schemaOutput = Symbol('spell.schemaOutput');\nexport declare const schemaAcceptsMissing: unique symbol;\nexport type AcceptsMissing = { readonly [schemaAcceptsMissing]: true };\n\n/** A structural schema surface accepted by composition helpers. */\nexport type SchemaSurface<Output = unknown, Input = Output> = {\n /** @internal */\n _parseFullAsync(value: unknown, ctx?: ParseContext): Promise<{ data: unknown; issues: Issue[] }>;\n /** @internal */\n _parseFullSync(value: unknown, ctx?: ParseContext): { data: unknown; issues: Issue[] };\n safeParseAsync(value: unknown, ctx?: ParseContext): Promise<ParseResult<Output>>;\n definition(): SchemaDescriptor;\n isOptional: boolean;\n optional(): SchemaSurface<Output | undefined, Input | undefined>;\n required(): SchemaSurface<Exclude<Output, undefined>, Exclude<Input, undefined>>;\n readonly [schemaInput]: Input;\n readonly [schemaOutput]: Output;\n};\n\nexport type AnySchema<Output = unknown, Input = Output> = SchemaSurface<Output, Input>;\n\n/**\n * The synchronous parse capability every schema carries. UI adapters that accept\n * `AnySchema` cannot call `safeParse` on it (the surface type omits it); type adapter\n * parameters against this instead.\n *\n * The shape is structural, so a schema with async checks is assignable to it; calling\n * `safeParse` on one returns a failed `ParseResult` (\"parse() cannot evaluate async\n * checks\"). Use `safeParseAsync` when async checks may be present.\n */\nexport type SyncParsable<T = unknown> = { safeParse(value: unknown): ParseResult<T> };\n\n/**\n * An issue path in either shape: spell-native `(string | number)[]` or the\n * Standard Schema `(PropertyKey | { key })[]` format.\n */\nexport type IssuePathSegment = PropertyKey | { readonly key: PropertyKey };\nexport type IssuePath = readonly IssuePathSegment[];\n\nexport type InferOutput<T> =\n T extends Schema<infer Output, unknown>\n ? Output\n : T extends { readonly [schemaOutput]: infer Output }\n ? Output\n : never;\ntype RawInferInput<T> = T extends { readonly [schemaInput]: infer Input } ? Input : unknown;\nexport type InferInput<T> = T extends AcceptsMissing ? RawInferInput<T> | undefined : RawInferInput<T>;\nexport type Infer<T> = InferOutput<T>;\n\n/** Re-exported for convenience — defined in messages.ts. */\nexport type { Messages } from './messages';\n"],"mappings":"AAEA,IAAa,EAAY,CACvB,OAAQ,SACR,eAAgB,iBAChB,aAAc,eACd,iBAAkB,mBAClB,aAAc,eACd,eAAgB,iBAChB,gBAAiB,kBACjB,aAAc,eACd,eAAgB,iBAChB,gBAAiB,kBACjB,oBAAqB,sBACrB,aAAc,eACd,eAAgB,iBAChB,aAAc,eACd,cAAe,gBACf,eAAgB,iBAChB,YAAa,cACb,gBAAiB,kBACjB,QAAS,UACT,UAAW,WACb"}
1
+ {"version":3,"file":"types.cjs","names":[],"sources":["../src/types.ts"],"sourcesContent":["/* -------------------- Error Codes -------------------- */\n\nexport const ErrorCode = {\n custom: 'custom',\n invalid_base64: 'invalid_base64',\n invalid_date: 'invalid_date',\n invalid_duration: 'invalid_duration',\n invalid_enum: 'invalid_enum',\n invalid_finite: 'invalid_finite',\n invalid_integer: 'invalid_integer',\n invalid_keys: 'invalid_keys',\n invalid_length: 'invalid_length',\n invalid_literal: 'invalid_literal',\n invalid_multiple_of: 'invalid_multiple_of',\n invalid_safe: 'invalid_safe',\n invalid_string: 'invalid_string',\n invalid_type: 'invalid_type',\n invalid_union: 'invalid_union',\n invalid_unique: 'invalid_unique',\n invalid_url: 'invalid_url',\n invalid_variant: 'invalid_variant',\n too_big: 'too_big',\n too_small: 'too_small',\n} as const;\n\nexport type ErrorCode = (typeof ErrorCode)[keyof typeof ErrorCode];\n\n/* -------------------- Messages -------------------- */\n\n/**\n * A validation message: either a static string or a function that receives context and returns a string.\n * **Note:** Static string values are used verbatim with no interpolation. Use the function form\n * for context-dependent messages (e.g. `(ctx) => \\`Must be at least ${ctx.min}\\``).\n */\nexport type MessageFn<Ctx extends Record<string, unknown> = Record<string, unknown>> = string | ((ctx: Ctx) => string);\n\n/* -------------------- JSON Schema -------------------- */\n\n/** Plain JSON Schema object (targeting JSON Schema 2020-12). */\nexport type JsonSchema = Record<string, unknown>;\n\nexport interface StandardSchemaV1<Input = unknown, Output = Input> {\n readonly '~standard': StandardSchemaV1.Props<Input, Output>;\n}\n\nexport declare namespace StandardSchemaV1 {\n interface Props<Input = unknown, Output = Input> {\n readonly types?: Types<Input, Output> | undefined;\n readonly validate: (value: unknown, options?: Options | undefined) => Result<Output> | Promise<Result<Output>>;\n readonly vendor: string;\n readonly version: 1;\n }\n\n type Result<Output> = { readonly issues: readonly Issue[] } | { readonly issues?: undefined; readonly value: Output };\n\n interface Options {\n readonly libraryOptions?: Record<string, unknown> | undefined;\n }\n\n interface Issue {\n readonly message: string;\n readonly path?: readonly (PropertyKey | PathSegment)[] | undefined;\n }\n\n interface PathSegment {\n readonly key: PropertyKey;\n }\n\n interface Types<Input = unknown, Output = Input> {\n readonly input: Input;\n readonly output: Output;\n }\n\n type InferInput<Schema extends StandardSchemaV1> = NonNullable<Schema['~standard']['types']>['input'];\n type InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema['~standard']['types']>['output'];\n}\n\n/* -------------------- Issues -------------------- */\n\n/**\n * A typed discriminated union of all issues emitted by built-in validators.\n *\n * Narrowing on `code` gives precise access to `params`:\n * ```ts\n * if (error.code === 'too_small') {\n * const min = error.params.min; // number | bigint | Date\n * }\n * ```\n */\nexport type Issue =\n | { code: 'custom'; message: string; params?: Record<string, unknown>; path: (string | number)[] }\n | { code: 'invalid_base64'; message: string; params: { format: string }; path: (string | number)[] }\n | { code: 'invalid_date'; message: string; params?: undefined; path: (string | number)[] }\n | { code: 'invalid_duration'; message: string; params: { format: string }; path: (string | number)[] }\n | { code: 'invalid_enum'; message: string; params: { values: readonly unknown[] }; path: (string | number)[] }\n | { code: 'invalid_finite'; message: string; params?: undefined; path: (string | number)[] }\n | { code: 'invalid_integer'; message: string; params?: undefined; path: (string | number)[] }\n | { code: 'invalid_keys'; message: string; params: { keys: string[] }; path: (string | number)[] }\n | { code: 'invalid_length'; message: string; params: { exact: number }; path: (string | number)[] }\n | { code: 'invalid_literal'; message: string; params: { expected: unknown }; path: (string | number)[] }\n | { code: 'invalid_multiple_of'; message: string; params: { step: number | bigint }; path: (string | number)[] }\n | { code: 'invalid_safe'; message: string; params?: undefined; path: (string | number)[] }\n | {\n code: 'invalid_string';\n message: string;\n params: { format?: string; includes?: string; pattern?: string; prefix?: string; suffix?: string };\n path: (string | number)[];\n }\n | { code: 'invalid_type'; message: string; params?: undefined; path: (string | number)[] }\n | { code: 'invalid_union'; message: string; params: { errors: Issue[][] }; path: (string | number)[] }\n | { code: 'invalid_unique'; message: string; params: { unique: true }; path: (string | number)[] }\n | { code: 'invalid_url'; message: string; params: { format: string }; path: (string | number)[] }\n | {\n code: 'invalid_variant';\n message: string;\n params: { discriminator: string; expected: string[] };\n path: (string | number)[];\n }\n | {\n code: 'too_big';\n message: string;\n params: { exclusive?: boolean; max: number | bigint | Date };\n path: (string | number)[];\n }\n | {\n code: 'too_small';\n message: string;\n params: { exclusive?: boolean; min: number | bigint | Date };\n path: (string | number)[];\n }\n | { code: string & {}; message: string; params?: Record<string, unknown>; path: (string | number)[] };\n\n/** ParseContext carries the active message set through the parse pipeline. */\nexport type ParseContext = {\n messages: import('./messages').Messages;\n};\n\n/**\n * Validator function. Receives the value after type-checking and the active ParseContext.\n * Returns an Issue array on failure, null on success, or a Promise for async validators.\n */\nexport type ValidateFn = (value: unknown, ctx?: ParseContext) => Issue[] | null | Promise<Issue[] | null>;\n\nexport type CheckContext = {\n addIssue: (issue: {\n code: string;\n message: string;\n params?: Record<string, unknown>;\n path?: (string | number)[];\n }) => void;\n};\n\n/**\n * Return type of a `check()` callback.\n * - `string`: validation failed; the string becomes the error message.\n * - `false`: validation failed with no message (use `addIssue` for a message).\n * - `true` / `null` / `void`: validation passed.\n *\n * The shorthand `condition || 'message'` works naturally:\n * ```ts\n * s.string().check((value) => value.length > 0 || 'Cannot be empty')\n * ```\n */\nexport type ValidateResult = boolean | null | undefined | string;\n\n/** Re-exported from errors for convenience: defined there. */\nexport type { FlatError, FlatErrorFirst } from './errors';\n\ntype BaseDescriptor = {\n description?: string;\n isNullable?: boolean;\n isOptional?: boolean;\n};\n\nexport type SchemaDescriptor = BaseDescriptor &\n (\n | { kind: 'unknown' | 'never' | 'boolean' | 'bigint' | 'date' | 'lazy' }\n | { className: string; kind: 'instanceof' }\n | {\n contentEncoding?: string;\n format?: string;\n kind: 'string';\n maxLength?: number;\n minLength?: number;\n pattern?: string | null;\n }\n | {\n exclusiveMaximum?: number;\n exclusiveMinimum?: number;\n kind: 'number';\n maximum?: number;\n minimum?: number;\n multipleOf?: number;\n typeHint?: 'integer';\n }\n | { kind: 'literal'; value: string | number | boolean | null | undefined }\n | { kind: 'enum'; values: readonly (string | number)[] }\n | { items: SchemaDescriptor; kind: 'array'; maxItems?: number; minItems?: number }\n | { items: SchemaDescriptor[]; kind: 'tuple'; rest: SchemaDescriptor | null }\n | { fields: Record<string, SchemaDescriptor>; kind: 'object'; strict: boolean }\n | { key: SchemaDescriptor; kind: 'record'; value: SchemaDescriptor }\n | { items: SchemaDescriptor; kind: 'set' }\n | { key: SchemaDescriptor; kind: 'map'; value: SchemaDescriptor }\n | { branches: SchemaDescriptor[]; kind: 'union' | 'intersect' }\n | { branches: Record<string, SchemaDescriptor>; discriminator: string; kind: 'variant' }\n | { from: SchemaDescriptor; kind: 'pipe'; to: SchemaDescriptor }\n );\n\n/* -------------------- ParseResult (forward-references SpellValidationError) -------------------- */\n\nimport type { Schema } from './core';\n// Import only the type to avoid circular dependencies\nimport type { SpellValidationError } from './errors';\n\nexport type ParseResult<T> = { data: T; success: true } | { error: SpellValidationError; success: false };\n\n/* -------------------- Schema execution mode / Infer (forward-references Schema) -------------------- */\n\n/** Structural marker for a schema's input type. Emitted so public types can key on it. */\nexport const schemaInput = Symbol('spell.schemaInput');\n/** Structural marker for a schema's output type. Emitted so public types can key on it. */\nexport const schemaOutput = Symbol('spell.schemaOutput');\nexport declare const schemaAcceptsMissing: unique symbol;\nexport type AcceptsMissing = { readonly [schemaAcceptsMissing]: true };\n\n/** A structural schema surface accepted by composition helpers. */\nexport type SchemaSurface<Output = unknown, Input = Output> = {\n /** @internal */\n _parseFullAsync(value: unknown, ctx?: ParseContext): Promise<{ data: unknown; issues: Issue[] }>;\n /** @internal */\n _parseFullSync(value: unknown, ctx?: ParseContext): { data: unknown; issues: Issue[] };\n safeParseAsync(value: unknown, ctx?: ParseContext): Promise<ParseResult<Output>>;\n definition(): SchemaDescriptor;\n isOptional: boolean;\n optional(): SchemaSurface<Output | undefined, Input | undefined>;\n required(): SchemaSurface<Exclude<Output, undefined>, Exclude<Input, undefined>>;\n readonly [schemaInput]: Input;\n readonly [schemaOutput]: Output;\n};\n\nexport type AnySchema<Output = unknown, Input = Output> = SchemaSurface<Output, Input>;\n\n/**\n * The synchronous parse capability every schema carries. UI adapters that accept\n * `AnySchema` cannot call `safeParse` on it (the surface type omits it); type adapter\n * parameters against this instead.\n *\n * The shape is structural, so a schema with async checks is assignable to it; calling\n * `safeParse` on one returns a failed `ParseResult` (\"parse() cannot evaluate async\n * checks\"). Use `safeParseAsync` when async checks may be present.\n */\nexport type SyncParsable<T = unknown> = { safeParse(value: unknown): ParseResult<T> };\n\n/**\n * An issue path in either shape: spell-native `(string | number)[]` or the\n * Standard Schema `(PropertyKey | { key })[]` format.\n */\nexport type IssuePathSegment = PropertyKey | { readonly key: PropertyKey };\nexport type IssuePath = readonly IssuePathSegment[];\n\nexport type InferOutput<T> =\n T extends Schema<infer Output, unknown>\n ? Output\n : T extends { readonly [schemaOutput]: infer Output }\n ? Output\n : never;\ntype RawInferInput<T> = T extends { readonly [schemaInput]: infer Input } ? Input : unknown;\nexport type InferInput<T> = T extends AcceptsMissing ? RawInferInput<T> | undefined : RawInferInput<T>;\nexport type Infer<T> = InferOutput<T>;\n\n/** Re-exported for convenience: defined in messages.ts. */\nexport type { Messages } from './messages';\n"],"mappings":"AAEA,IAAa,EAAY,CACvB,OAAQ,SACR,eAAgB,iBAChB,aAAc,eACd,iBAAkB,mBAClB,aAAc,eACd,eAAgB,iBAChB,gBAAiB,kBACjB,aAAc,eACd,eAAgB,iBAChB,gBAAiB,kBACjB,oBAAqB,sBACrB,aAAc,eACd,eAAgB,iBAChB,aAAc,eACd,cAAe,gBACf,eAAgB,iBAChB,YAAa,cACb,gBAAiB,kBACjB,QAAS,UACT,UAAW,WACb"}
package/dist/types.d.ts CHANGED
@@ -22,7 +22,7 @@ export declare const ErrorCode: {
22
22
  };
23
23
  export type ErrorCode = (typeof ErrorCode)[keyof typeof ErrorCode];
24
24
  /**
25
- * A validation message — either a static string or a function that receives context and returns a string.
25
+ * A validation message: either a static string or a function that receives context and returns a string.
26
26
  * **Note:** Static string values are used verbatim with no interpolation. Use the function form
27
27
  * for context-dependent messages (e.g. `(ctx) => \`Must be at least ${ctx.min}\``).
28
28
  */
@@ -232,9 +232,9 @@ export type CheckContext = {
232
232
  };
233
233
  /**
234
234
  * Return type of a `check()` callback.
235
- * - `string` — validation failed; the string becomes the error message.
236
- * - `false` — validation failed with no message (use `addIssue` for a message).
237
- * - `true` / `null` / `void` — validation passed.
235
+ * - `string`: validation failed; the string becomes the error message.
236
+ * - `false`: validation failed with no message (use `addIssue` for a message).
237
+ * - `true` / `null` / `void`: validation passed.
238
238
  *
239
239
  * The shorthand `condition || 'message'` works naturally:
240
240
  * ```ts
@@ -242,7 +242,7 @@ export type CheckContext = {
242
242
  * ```
243
243
  */
244
244
  export type ValidateResult = boolean | null | undefined | string;
245
- /** Re-exported from errors for convenience — defined there. */
245
+ /** Re-exported from errors for convenience: defined there. */
246
246
  export type { FlatError, FlatErrorFirst } from './errors';
247
247
  type BaseDescriptor = {
248
248
  description?: string;
@@ -367,6 +367,6 @@ type RawInferInput<T> = T extends {
367
367
  } ? Input : unknown;
368
368
  export type InferInput<T> = T extends AcceptsMissing ? RawInferInput<T> | undefined : RawInferInput<T>;
369
369
  export type Infer<T> = InferOutput<T>;
370
- /** Re-exported for convenience — defined in messages.ts. */
370
+ /** Re-exported for convenience: defined in messages.ts. */
371
371
  export type { Messages } from './messages';
372
372
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;CAqBZ,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC;AAInE;;;;GAIG;AACH,MAAM,MAAM,SAAS,CAAC,GAAG,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAA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GAAG,OAAO,IAAI;IAAE,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW,CAAC,CAAC,CAAC,CAAA;CAAE,CAAC;AAEtF;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG;IAAE,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAA;CAAE,CAAC;AAC3E,MAAM,MAAM,SAAS,GAAG,SAAS,gBAAgB,EAAE,CAAC;AAEpD,MAAM,MAAM,WAAW,CAAC,CAAC,IACvB,CAAC,SAAS,MAAM,CAAC,MAAM,MAAM,EAAE,OAAO,CAAC,GACnC,MAAM,GACN,CAAC,SAAS;IAAE,QAAQ,CAAC,CAAC,YAAY,CAAC,EAAE,MAAM,MAAM,CAAA;CAAE,GACjD,MAAM,GACN,KAAK,CAAC;AACd,KAAK,aAAa,CAAC,CAAC,IAAI,CAAC,SAAS;IAAE,QAAQ,CAAC,CAAC,WAAW,CAAC,EAAE,MAAM,KAAK,CAAA;CAAE,GAAG,KAAK,GAAG,OAAO,CAAC;AAC5F,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,CAAC,SAAS,cAAc,GAAG,aAAa,CAAC,CAAC,CAAC,GAAG,SAAS,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;AACvG,MAAM,MAAM,KAAK,CAAC,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC;AAEtC,2DAA2D;AAC3D,YAAY,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../src/types.ts"],"sourcesContent":["/* -------------------- Error Codes -------------------- */\n\nexport const ErrorCode = {\n custom: 'custom',\n invalid_base64: 'invalid_base64',\n invalid_date: 'invalid_date',\n invalid_duration: 'invalid_duration',\n invalid_enum: 'invalid_enum',\n invalid_finite: 'invalid_finite',\n invalid_integer: 'invalid_integer',\n invalid_keys: 'invalid_keys',\n invalid_length: 'invalid_length',\n invalid_literal: 'invalid_literal',\n invalid_multiple_of: 'invalid_multiple_of',\n invalid_safe: 'invalid_safe',\n invalid_string: 'invalid_string',\n invalid_type: 'invalid_type',\n invalid_union: 'invalid_union',\n invalid_unique: 'invalid_unique',\n invalid_url: 'invalid_url',\n invalid_variant: 'invalid_variant',\n too_big: 'too_big',\n too_small: 'too_small',\n} as const;\n\nexport type ErrorCode = (typeof ErrorCode)[keyof typeof ErrorCode];\n\n/* -------------------- Messages -------------------- */\n\n/**\n * A validation message — either a static string or a function that receives context and returns a string.\n * **Note:** Static string values are used verbatim with no interpolation. Use the function form\n * for context-dependent messages (e.g. `(ctx) => \\`Must be at least ${ctx.min}\\``).\n */\nexport type MessageFn<Ctx extends Record<string, unknown> = Record<string, unknown>> = string | ((ctx: Ctx) => string);\n\n/* -------------------- JSON Schema -------------------- */\n\n/** Plain JSON Schema object (targeting JSON Schema 2020-12). */\nexport type JsonSchema = Record<string, unknown>;\n\nexport interface StandardSchemaV1<Input = unknown, Output = Input> {\n readonly '~standard': StandardSchemaV1.Props<Input, Output>;\n}\n\nexport declare namespace StandardSchemaV1 {\n interface Props<Input = unknown, Output = Input> {\n readonly types?: Types<Input, Output> | undefined;\n readonly validate: (value: unknown, options?: Options | undefined) => Result<Output> | Promise<Result<Output>>;\n readonly vendor: string;\n readonly version: 1;\n }\n\n type Result<Output> = { readonly issues: readonly Issue[] } | { readonly issues?: undefined; readonly value: Output };\n\n interface Options {\n readonly libraryOptions?: Record<string, unknown> | undefined;\n }\n\n interface Issue {\n readonly message: string;\n readonly path?: readonly (PropertyKey | PathSegment)[] | undefined;\n }\n\n interface PathSegment {\n readonly key: PropertyKey;\n }\n\n interface Types<Input = unknown, Output = Input> {\n readonly input: Input;\n readonly output: Output;\n }\n\n type InferInput<Schema extends StandardSchemaV1> = NonNullable<Schema['~standard']['types']>['input'];\n type InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema['~standard']['types']>['output'];\n}\n\n/* -------------------- Issues -------------------- */\n\n/**\n * A typed discriminated union of all issues emitted by built-in validators.\n *\n * Narrowing on `code` gives precise access to `params`:\n * ```ts\n * if (error.code === 'too_small') {\n * const min = error.params.min; // number | bigint | Date\n * }\n * ```\n */\nexport type Issue =\n | { code: 'custom'; message: string; params?: Record<string, unknown>; path: (string | number)[] }\n | { code: 'invalid_base64'; message: string; params: { format: string }; path: (string | number)[] }\n | { code: 'invalid_date'; message: string; params?: undefined; path: (string | number)[] }\n | { code: 'invalid_duration'; message: string; params: { format: string }; path: (string | number)[] }\n | { code: 'invalid_enum'; message: string; params: { values: readonly unknown[] }; path: (string | number)[] }\n | { code: 'invalid_finite'; message: string; params?: undefined; path: (string | number)[] }\n | { code: 'invalid_integer'; message: string; params?: undefined; path: (string | number)[] }\n | { code: 'invalid_keys'; message: string; params: { keys: string[] }; path: (string | number)[] }\n | { code: 'invalid_length'; message: string; params: { exact: number }; path: (string | number)[] }\n | { code: 'invalid_literal'; message: string; params: { expected: unknown }; path: (string | number)[] }\n | { code: 'invalid_multiple_of'; message: string; params: { step: number | bigint }; path: (string | number)[] }\n | { code: 'invalid_safe'; message: string; params?: undefined; path: (string | number)[] }\n | {\n code: 'invalid_string';\n message: string;\n params: { format?: string; includes?: string; pattern?: string; prefix?: string; suffix?: string };\n path: (string | number)[];\n }\n | { code: 'invalid_type'; message: string; params?: undefined; path: (string | number)[] }\n | { code: 'invalid_union'; message: string; params: { errors: Issue[][] }; path: (string | number)[] }\n | { code: 'invalid_unique'; message: string; params: { unique: true }; path: (string | number)[] }\n | { code: 'invalid_url'; message: string; params: { format: string }; path: (string | number)[] }\n | {\n code: 'invalid_variant';\n message: string;\n params: { discriminator: string; expected: string[] };\n path: (string | number)[];\n }\n | {\n code: 'too_big';\n message: string;\n params: { exclusive?: boolean; max: number | bigint | Date };\n path: (string | number)[];\n }\n | {\n code: 'too_small';\n message: string;\n params: { exclusive?: boolean; min: number | bigint | Date };\n path: (string | number)[];\n }\n | { code: string & {}; message: string; params?: Record<string, unknown>; path: (string | number)[] };\n\n/** ParseContext carries the active message set through the parse pipeline. */\nexport type ParseContext = {\n messages: import('./messages').Messages;\n};\n\n/**\n * Validator function. Receives the value after type-checking and the active ParseContext.\n * Returns an Issue array on failure, null on success, or a Promise for async validators.\n */\nexport type ValidateFn = (value: unknown, ctx?: ParseContext) => Issue[] | null | Promise<Issue[] | null>;\n\nexport type CheckContext = {\n addIssue: (issue: {\n code: string;\n message: string;\n params?: Record<string, unknown>;\n path?: (string | number)[];\n }) => void;\n};\n\n/**\n * Return type of a `check()` callback.\n * - `string` — validation failed; the string becomes the error message.\n * - `false` — validation failed with no message (use `addIssue` for a message).\n * - `true` / `null` / `void` — validation passed.\n *\n * The shorthand `condition || 'message'` works naturally:\n * ```ts\n * s.string().check((value) => value.length > 0 || 'Cannot be empty')\n * ```\n */\nexport type ValidateResult = boolean | null | undefined | string;\n\n/** Re-exported from errors for convenience — defined there. */\nexport type { FlatError, FlatErrorFirst } from './errors';\n\ntype BaseDescriptor = {\n description?: string;\n isNullable?: boolean;\n isOptional?: boolean;\n};\n\nexport type SchemaDescriptor = BaseDescriptor &\n (\n | { kind: 'unknown' | 'never' | 'boolean' | 'bigint' | 'date' | 'lazy' }\n | { className: string; kind: 'instanceof' }\n | {\n contentEncoding?: string;\n format?: string;\n kind: 'string';\n maxLength?: number;\n minLength?: number;\n pattern?: string | null;\n }\n | {\n exclusiveMaximum?: number;\n exclusiveMinimum?: number;\n kind: 'number';\n maximum?: number;\n minimum?: number;\n multipleOf?: number;\n typeHint?: 'integer';\n }\n | { kind: 'literal'; value: string | number | boolean | null | undefined }\n | { kind: 'enum'; values: readonly (string | number)[] }\n | { items: SchemaDescriptor; kind: 'array'; maxItems?: number; minItems?: number }\n | { items: SchemaDescriptor[]; kind: 'tuple'; rest: SchemaDescriptor | null }\n | { fields: Record<string, SchemaDescriptor>; kind: 'object'; strict: boolean }\n | { key: SchemaDescriptor; kind: 'record'; value: SchemaDescriptor }\n | { items: SchemaDescriptor; kind: 'set' }\n | { key: SchemaDescriptor; kind: 'map'; value: SchemaDescriptor }\n | { branches: SchemaDescriptor[]; kind: 'union' | 'intersect' }\n | { branches: Record<string, SchemaDescriptor>; discriminator: string; kind: 'variant' }\n | { from: SchemaDescriptor; kind: 'pipe'; to: SchemaDescriptor }\n );\n\n/* -------------------- ParseResult (forward-references SpellValidationError) -------------------- */\n\nimport type { Schema } from './core';\n// Import only the type to avoid circular dependencies\nimport type { SpellValidationError } from './errors';\n\nexport type ParseResult<T> = { data: T; success: true } | { error: SpellValidationError; success: false };\n\n/* -------------------- Schema execution mode / Infer (forward-references Schema) -------------------- */\n\n/** Structural marker for a schema's input type. Emitted so public types can key on it. */\nexport const schemaInput = Symbol('spell.schemaInput');\n/** Structural marker for a schema's output type. Emitted so public types can key on it. */\nexport const schemaOutput = Symbol('spell.schemaOutput');\nexport declare const schemaAcceptsMissing: unique symbol;\nexport type AcceptsMissing = { readonly [schemaAcceptsMissing]: true };\n\n/** A structural schema surface accepted by composition helpers. */\nexport type SchemaSurface<Output = unknown, Input = Output> = {\n /** @internal */\n _parseFullAsync(value: unknown, ctx?: ParseContext): Promise<{ data: unknown; issues: Issue[] }>;\n /** @internal */\n _parseFullSync(value: unknown, ctx?: ParseContext): { data: unknown; issues: Issue[] };\n safeParseAsync(value: unknown, ctx?: ParseContext): Promise<ParseResult<Output>>;\n definition(): SchemaDescriptor;\n isOptional: boolean;\n optional(): SchemaSurface<Output | undefined, Input | undefined>;\n required(): SchemaSurface<Exclude<Output, undefined>, Exclude<Input, undefined>>;\n readonly [schemaInput]: Input;\n readonly [schemaOutput]: Output;\n};\n\nexport type AnySchema<Output = unknown, Input = Output> = SchemaSurface<Output, Input>;\n\n/**\n * The synchronous parse capability every schema carries. UI adapters that accept\n * `AnySchema` cannot call `safeParse` on it (the surface type omits it); type adapter\n * parameters against this instead.\n *\n * The shape is structural, so a schema with async checks is assignable to it; calling\n * `safeParse` on one returns a failed `ParseResult` (\"parse() cannot evaluate async\n * checks\"). Use `safeParseAsync` when async checks may be present.\n */\nexport type SyncParsable<T = unknown> = { safeParse(value: unknown): ParseResult<T> };\n\n/**\n * An issue path in either shape: spell-native `(string | number)[]` or the\n * Standard Schema `(PropertyKey | { key })[]` format.\n */\nexport type IssuePathSegment = PropertyKey | { readonly key: PropertyKey };\nexport type IssuePath = readonly IssuePathSegment[];\n\nexport type InferOutput<T> =\n T extends Schema<infer Output, unknown>\n ? Output\n : T extends { readonly [schemaOutput]: infer Output }\n ? Output\n : never;\ntype RawInferInput<T> = T extends { readonly [schemaInput]: infer Input } ? Input : unknown;\nexport type InferInput<T> = T extends AcceptsMissing ? RawInferInput<T> | undefined : RawInferInput<T>;\nexport type Infer<T> = InferOutput<T>;\n\n/** Re-exported for convenience — defined in messages.ts. */\nexport type { Messages } from './messages';\n"],"mappings":"AAEA,IAAa,EAAY,CACvB,OAAQ,SACR,eAAgB,iBAChB,aAAc,eACd,iBAAkB,mBAClB,aAAc,eACd,eAAgB,iBAChB,gBAAiB,kBACjB,aAAc,eACd,eAAgB,iBAChB,gBAAiB,kBACjB,oBAAqB,sBACrB,aAAc,eACd,eAAgB,iBAChB,aAAc,eACd,cAAe,gBACf,eAAgB,iBAChB,YAAa,cACb,gBAAiB,kBACjB,QAAS,UACT,UAAW,WACb"}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../src/types.ts"],"sourcesContent":["/* -------------------- Error Codes -------------------- */\n\nexport const ErrorCode = {\n custom: 'custom',\n invalid_base64: 'invalid_base64',\n invalid_date: 'invalid_date',\n invalid_duration: 'invalid_duration',\n invalid_enum: 'invalid_enum',\n invalid_finite: 'invalid_finite',\n invalid_integer: 'invalid_integer',\n invalid_keys: 'invalid_keys',\n invalid_length: 'invalid_length',\n invalid_literal: 'invalid_literal',\n invalid_multiple_of: 'invalid_multiple_of',\n invalid_safe: 'invalid_safe',\n invalid_string: 'invalid_string',\n invalid_type: 'invalid_type',\n invalid_union: 'invalid_union',\n invalid_unique: 'invalid_unique',\n invalid_url: 'invalid_url',\n invalid_variant: 'invalid_variant',\n too_big: 'too_big',\n too_small: 'too_small',\n} as const;\n\nexport type ErrorCode = (typeof ErrorCode)[keyof typeof ErrorCode];\n\n/* -------------------- Messages -------------------- */\n\n/**\n * A validation message: either a static string or a function that receives context and returns a string.\n * **Note:** Static string values are used verbatim with no interpolation. Use the function form\n * for context-dependent messages (e.g. `(ctx) => \\`Must be at least ${ctx.min}\\``).\n */\nexport type MessageFn<Ctx extends Record<string, unknown> = Record<string, unknown>> = string | ((ctx: Ctx) => string);\n\n/* -------------------- JSON Schema -------------------- */\n\n/** Plain JSON Schema object (targeting JSON Schema 2020-12). */\nexport type JsonSchema = Record<string, unknown>;\n\nexport interface StandardSchemaV1<Input = unknown, Output = Input> {\n readonly '~standard': StandardSchemaV1.Props<Input, Output>;\n}\n\nexport declare namespace StandardSchemaV1 {\n interface Props<Input = unknown, Output = Input> {\n readonly types?: Types<Input, Output> | undefined;\n readonly validate: (value: unknown, options?: Options | undefined) => Result<Output> | Promise<Result<Output>>;\n readonly vendor: string;\n readonly version: 1;\n }\n\n type Result<Output> = { readonly issues: readonly Issue[] } | { readonly issues?: undefined; readonly value: Output };\n\n interface Options {\n readonly libraryOptions?: Record<string, unknown> | undefined;\n }\n\n interface Issue {\n readonly message: string;\n readonly path?: readonly (PropertyKey | PathSegment)[] | undefined;\n }\n\n interface PathSegment {\n readonly key: PropertyKey;\n }\n\n interface Types<Input = unknown, Output = Input> {\n readonly input: Input;\n readonly output: Output;\n }\n\n type InferInput<Schema extends StandardSchemaV1> = NonNullable<Schema['~standard']['types']>['input'];\n type InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema['~standard']['types']>['output'];\n}\n\n/* -------------------- Issues -------------------- */\n\n/**\n * A typed discriminated union of all issues emitted by built-in validators.\n *\n * Narrowing on `code` gives precise access to `params`:\n * ```ts\n * if (error.code === 'too_small') {\n * const min = error.params.min; // number | bigint | Date\n * }\n * ```\n */\nexport type Issue =\n | { code: 'custom'; message: string; params?: Record<string, unknown>; path: (string | number)[] }\n | { code: 'invalid_base64'; message: string; params: { format: string }; path: (string | number)[] }\n | { code: 'invalid_date'; message: string; params?: undefined; path: (string | number)[] }\n | { code: 'invalid_duration'; message: string; params: { format: string }; path: (string | number)[] }\n | { code: 'invalid_enum'; message: string; params: { values: readonly unknown[] }; path: (string | number)[] }\n | { code: 'invalid_finite'; message: string; params?: undefined; path: (string | number)[] }\n | { code: 'invalid_integer'; message: string; params?: undefined; path: (string | number)[] }\n | { code: 'invalid_keys'; message: string; params: { keys: string[] }; path: (string | number)[] }\n | { code: 'invalid_length'; message: string; params: { exact: number }; path: (string | number)[] }\n | { code: 'invalid_literal'; message: string; params: { expected: unknown }; path: (string | number)[] }\n | { code: 'invalid_multiple_of'; message: string; params: { step: number | bigint }; path: (string | number)[] }\n | { code: 'invalid_safe'; message: string; params?: undefined; path: (string | number)[] }\n | {\n code: 'invalid_string';\n message: string;\n params: { format?: string; includes?: string; pattern?: string; prefix?: string; suffix?: string };\n path: (string | number)[];\n }\n | { code: 'invalid_type'; message: string; params?: undefined; path: (string | number)[] }\n | { code: 'invalid_union'; message: string; params: { errors: Issue[][] }; path: (string | number)[] }\n | { code: 'invalid_unique'; message: string; params: { unique: true }; path: (string | number)[] }\n | { code: 'invalid_url'; message: string; params: { format: string }; path: (string | number)[] }\n | {\n code: 'invalid_variant';\n message: string;\n params: { discriminator: string; expected: string[] };\n path: (string | number)[];\n }\n | {\n code: 'too_big';\n message: string;\n params: { exclusive?: boolean; max: number | bigint | Date };\n path: (string | number)[];\n }\n | {\n code: 'too_small';\n message: string;\n params: { exclusive?: boolean; min: number | bigint | Date };\n path: (string | number)[];\n }\n | { code: string & {}; message: string; params?: Record<string, unknown>; path: (string | number)[] };\n\n/** ParseContext carries the active message set through the parse pipeline. */\nexport type ParseContext = {\n messages: import('./messages').Messages;\n};\n\n/**\n * Validator function. Receives the value after type-checking and the active ParseContext.\n * Returns an Issue array on failure, null on success, or a Promise for async validators.\n */\nexport type ValidateFn = (value: unknown, ctx?: ParseContext) => Issue[] | null | Promise<Issue[] | null>;\n\nexport type CheckContext = {\n addIssue: (issue: {\n code: string;\n message: string;\n params?: Record<string, unknown>;\n path?: (string | number)[];\n }) => void;\n};\n\n/**\n * Return type of a `check()` callback.\n * - `string`: validation failed; the string becomes the error message.\n * - `false`: validation failed with no message (use `addIssue` for a message).\n * - `true` / `null` / `void`: validation passed.\n *\n * The shorthand `condition || 'message'` works naturally:\n * ```ts\n * s.string().check((value) => value.length > 0 || 'Cannot be empty')\n * ```\n */\nexport type ValidateResult = boolean | null | undefined | string;\n\n/** Re-exported from errors for convenience: defined there. */\nexport type { FlatError, FlatErrorFirst } from './errors';\n\ntype BaseDescriptor = {\n description?: string;\n isNullable?: boolean;\n isOptional?: boolean;\n};\n\nexport type SchemaDescriptor = BaseDescriptor &\n (\n | { kind: 'unknown' | 'never' | 'boolean' | 'bigint' | 'date' | 'lazy' }\n | { className: string; kind: 'instanceof' }\n | {\n contentEncoding?: string;\n format?: string;\n kind: 'string';\n maxLength?: number;\n minLength?: number;\n pattern?: string | null;\n }\n | {\n exclusiveMaximum?: number;\n exclusiveMinimum?: number;\n kind: 'number';\n maximum?: number;\n minimum?: number;\n multipleOf?: number;\n typeHint?: 'integer';\n }\n | { kind: 'literal'; value: string | number | boolean | null | undefined }\n | { kind: 'enum'; values: readonly (string | number)[] }\n | { items: SchemaDescriptor; kind: 'array'; maxItems?: number; minItems?: number }\n | { items: SchemaDescriptor[]; kind: 'tuple'; rest: SchemaDescriptor | null }\n | { fields: Record<string, SchemaDescriptor>; kind: 'object'; strict: boolean }\n | { key: SchemaDescriptor; kind: 'record'; value: SchemaDescriptor }\n | { items: SchemaDescriptor; kind: 'set' }\n | { key: SchemaDescriptor; kind: 'map'; value: SchemaDescriptor }\n | { branches: SchemaDescriptor[]; kind: 'union' | 'intersect' }\n | { branches: Record<string, SchemaDescriptor>; discriminator: string; kind: 'variant' }\n | { from: SchemaDescriptor; kind: 'pipe'; to: SchemaDescriptor }\n );\n\n/* -------------------- ParseResult (forward-references SpellValidationError) -------------------- */\n\nimport type { Schema } from './core';\n// Import only the type to avoid circular dependencies\nimport type { SpellValidationError } from './errors';\n\nexport type ParseResult<T> = { data: T; success: true } | { error: SpellValidationError; success: false };\n\n/* -------------------- Schema execution mode / Infer (forward-references Schema) -------------------- */\n\n/** Structural marker for a schema's input type. Emitted so public types can key on it. */\nexport const schemaInput = Symbol('spell.schemaInput');\n/** Structural marker for a schema's output type. Emitted so public types can key on it. */\nexport const schemaOutput = Symbol('spell.schemaOutput');\nexport declare const schemaAcceptsMissing: unique symbol;\nexport type AcceptsMissing = { readonly [schemaAcceptsMissing]: true };\n\n/** A structural schema surface accepted by composition helpers. */\nexport type SchemaSurface<Output = unknown, Input = Output> = {\n /** @internal */\n _parseFullAsync(value: unknown, ctx?: ParseContext): Promise<{ data: unknown; issues: Issue[] }>;\n /** @internal */\n _parseFullSync(value: unknown, ctx?: ParseContext): { data: unknown; issues: Issue[] };\n safeParseAsync(value: unknown, ctx?: ParseContext): Promise<ParseResult<Output>>;\n definition(): SchemaDescriptor;\n isOptional: boolean;\n optional(): SchemaSurface<Output | undefined, Input | undefined>;\n required(): SchemaSurface<Exclude<Output, undefined>, Exclude<Input, undefined>>;\n readonly [schemaInput]: Input;\n readonly [schemaOutput]: Output;\n};\n\nexport type AnySchema<Output = unknown, Input = Output> = SchemaSurface<Output, Input>;\n\n/**\n * The synchronous parse capability every schema carries. UI adapters that accept\n * `AnySchema` cannot call `safeParse` on it (the surface type omits it); type adapter\n * parameters against this instead.\n *\n * The shape is structural, so a schema with async checks is assignable to it; calling\n * `safeParse` on one returns a failed `ParseResult` (\"parse() cannot evaluate async\n * checks\"). Use `safeParseAsync` when async checks may be present.\n */\nexport type SyncParsable<T = unknown> = { safeParse(value: unknown): ParseResult<T> };\n\n/**\n * An issue path in either shape: spell-native `(string | number)[]` or the\n * Standard Schema `(PropertyKey | { key })[]` format.\n */\nexport type IssuePathSegment = PropertyKey | { readonly key: PropertyKey };\nexport type IssuePath = readonly IssuePathSegment[];\n\nexport type InferOutput<T> =\n T extends Schema<infer Output, unknown>\n ? Output\n : T extends { readonly [schemaOutput]: infer Output }\n ? Output\n : never;\ntype RawInferInput<T> = T extends { readonly [schemaInput]: infer Input } ? Input : unknown;\nexport type InferInput<T> = T extends AcceptsMissing ? RawInferInput<T> | undefined : RawInferInput<T>;\nexport type Infer<T> = InferOutput<T>;\n\n/** Re-exported for convenience: defined in messages.ts. */\nexport type { Messages } from './messages';\n"],"mappings":"AAEA,IAAa,EAAY,CACvB,OAAQ,SACR,eAAgB,iBAChB,aAAc,eACd,iBAAkB,mBAClB,aAAc,eACd,eAAgB,iBAChB,gBAAiB,kBACjB,aAAc,eACd,eAAgB,iBAChB,gBAAiB,kBACjB,oBAAqB,sBACrB,aAAc,eACd,eAAgB,iBAChB,aAAc,eACd,cAAe,gBACf,eAAgB,iBAChB,YAAa,cACb,gBAAiB,kBACjB,QAAS,UACT,UAAW,WACb"}
@@ -1 +1 @@
1
- {"version":3,"file":"validators.cjs","names":[],"sources":["../src/validators.ts"],"sourcesContent":["/**\n * Standalone validator functions — zero-dep, tree-shakeable helpers that return\n * a simple `boolean` (or a typed predicate) without constructing a Schema.\n * Useful in non-schema contexts such as conditional rendering, guards, etc.\n */\n\n/* -------------------- Generic range validators -------------------- */\n\nexport const hasMinLength = (value: string | unknown[], min: number): boolean => value.length >= min;\nexport const hasMaxLength = (value: string | unknown[], max: number): boolean => value.length <= max;\nexport const isInRange = (value: number, min: number, max: number): boolean => value >= min && value <= max;\nexport const isInteger = (value: number): boolean => Number.isInteger(value);\nexport const isPositive = (value: number): boolean => value > 0;\nexport const isNonNegative = (value: number): boolean => value >= 0;\nexport const isNegative = (value: number): boolean => value < 0;\nexport const isMultipleOf = (value: number, step: number): boolean => value % step === 0;\n\n/* -------------------- Type guards -------------------- */\n\nexport const isString = (value: unknown): value is string => typeof value === 'string';\nexport const isNumber = (value: unknown): value is number => typeof value === 'number' && !Number.isNaN(value);\nexport const isBoolean = (value: unknown): value is boolean => typeof value === 'boolean';\nexport const isNullOrUndefined = (value: unknown): value is null | undefined => value == null;\nexport const isDate = (value: unknown): value is Date => value instanceof Date && !Number.isNaN(value.getTime());\nexport const isArray = (value: unknown): value is unknown[] => Array.isArray(value);\n"],"mappings":"AAQA,IAAa,GAAgB,EAA2B,IAAyB,EAAM,QAAU,EACpF,GAAgB,EAA2B,IAAyB,EAAM,QAAU,EACpF,GAAa,EAAe,EAAa,IAAyB,GAAS,GAAO,GAAS,EAC3F,EAAa,GAA2B,OAAO,UAAU,CAAK,EAC9D,EAAc,GAA2B,EAAQ,EACjD,EAAiB,GAA2B,GAAS,EACrD,EAAc,GAA2B,EAAQ,EACjD,GAAgB,EAAe,IAA0B,EAAQ,IAAS,EAI1E,EAAY,GAAoC,OAAO,GAAU,SACjE,EAAY,GAAoC,OAAO,GAAU,UAAY,CAAC,OAAO,MAAM,CAAK,EAChG,EAAa,GAAqC,OAAO,GAAU,UACnE,EAAqB,GAA8C,GAAS,KAC5E,EAAU,GAAkC,aAAiB,MAAQ,CAAC,OAAO,MAAM,EAAM,QAAQ,CAAC,EAClG,EAAW,GAAuC,MAAM,QAAQ,CAAK"}
1
+ {"version":3,"file":"validators.cjs","names":[],"sources":["../src/validators.ts"],"sourcesContent":["/**\n * Standalone validator functions: zero-dep, tree-shakeable helpers that return\n * a simple `boolean` (or a typed predicate) without constructing a Schema.\n * Useful in non-schema contexts such as conditional rendering, guards, etc.\n */\n\n/* -------------------- Generic range validators -------------------- */\n\nexport const hasMinLength = (value: string | unknown[], min: number): boolean => value.length >= min;\nexport const hasMaxLength = (value: string | unknown[], max: number): boolean => value.length <= max;\nexport const isInRange = (value: number, min: number, max: number): boolean => value >= min && value <= max;\nexport const isInteger = (value: number): boolean => Number.isInteger(value);\nexport const isPositive = (value: number): boolean => value > 0;\nexport const isNonNegative = (value: number): boolean => value >= 0;\nexport const isNegative = (value: number): boolean => value < 0;\nexport const isMultipleOf = (value: number, step: number): boolean => value % step === 0;\n\n/* -------------------- Type guards -------------------- */\n\nexport const isString = (value: unknown): value is string => typeof value === 'string';\nexport const isNumber = (value: unknown): value is number => typeof value === 'number' && !Number.isNaN(value);\nexport const isBoolean = (value: unknown): value is boolean => typeof value === 'boolean';\nexport const isNullOrUndefined = (value: unknown): value is null | undefined => value == null;\nexport const isDate = (value: unknown): value is Date => value instanceof Date && !Number.isNaN(value.getTime());\nexport const isArray = (value: unknown): value is unknown[] => Array.isArray(value);\n"],"mappings":"AAQA,IAAa,GAAgB,EAA2B,IAAyB,EAAM,QAAU,EACpF,GAAgB,EAA2B,IAAyB,EAAM,QAAU,EACpF,GAAa,EAAe,EAAa,IAAyB,GAAS,GAAO,GAAS,EAC3F,EAAa,GAA2B,OAAO,UAAU,CAAK,EAC9D,EAAc,GAA2B,EAAQ,EACjD,EAAiB,GAA2B,GAAS,EACrD,EAAc,GAA2B,EAAQ,EACjD,GAAgB,EAAe,IAA0B,EAAQ,IAAS,EAI1E,EAAY,GAAoC,OAAO,GAAU,SACjE,EAAY,GAAoC,OAAO,GAAU,UAAY,CAAC,OAAO,MAAM,CAAK,EAChG,EAAa,GAAqC,OAAO,GAAU,UACnE,EAAqB,GAA8C,GAAS,KAC5E,EAAU,GAAkC,aAAiB,MAAQ,CAAC,OAAO,MAAM,EAAM,QAAQ,CAAC,EAClG,EAAW,GAAuC,MAAM,QAAQ,CAAK"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Standalone validator functions — zero-dep, tree-shakeable helpers that return
2
+ * Standalone validator functions: zero-dep, tree-shakeable helpers that return
3
3
  * a simple `boolean` (or a typed predicate) without constructing a Schema.
4
4
  * Useful in non-schema contexts such as conditional rendering, guards, etc.
5
5
  */
@@ -1 +1 @@
1
- {"version":3,"file":"validators.js","names":[],"sources":["../src/validators.ts"],"sourcesContent":["/**\n * Standalone validator functions — zero-dep, tree-shakeable helpers that return\n * a simple `boolean` (or a typed predicate) without constructing a Schema.\n * Useful in non-schema contexts such as conditional rendering, guards, etc.\n */\n\n/* -------------------- Generic range validators -------------------- */\n\nexport const hasMinLength = (value: string | unknown[], min: number): boolean => value.length >= min;\nexport const hasMaxLength = (value: string | unknown[], max: number): boolean => value.length <= max;\nexport const isInRange = (value: number, min: number, max: number): boolean => value >= min && value <= max;\nexport const isInteger = (value: number): boolean => Number.isInteger(value);\nexport const isPositive = (value: number): boolean => value > 0;\nexport const isNonNegative = (value: number): boolean => value >= 0;\nexport const isNegative = (value: number): boolean => value < 0;\nexport const isMultipleOf = (value: number, step: number): boolean => value % step === 0;\n\n/* -------------------- Type guards -------------------- */\n\nexport const isString = (value: unknown): value is string => typeof value === 'string';\nexport const isNumber = (value: unknown): value is number => typeof value === 'number' && !Number.isNaN(value);\nexport const isBoolean = (value: unknown): value is boolean => typeof value === 'boolean';\nexport const isNullOrUndefined = (value: unknown): value is null | undefined => value == null;\nexport const isDate = (value: unknown): value is Date => value instanceof Date && !Number.isNaN(value.getTime());\nexport const isArray = (value: unknown): value is unknown[] => Array.isArray(value);\n"],"mappings":"AAQA,IAAa,GAAgB,EAA2B,IAAyB,EAAM,QAAU,EACpF,GAAgB,EAA2B,IAAyB,EAAM,QAAU,EACpF,GAAa,EAAe,EAAa,IAAyB,GAAS,GAAO,GAAS,EAC3F,EAAa,GAA2B,OAAO,UAAU,CAAK,EAC9D,EAAc,GAA2B,EAAQ,EACjD,EAAiB,GAA2B,GAAS,EACrD,EAAc,GAA2B,EAAQ,EACjD,GAAgB,EAAe,IAA0B,EAAQ,IAAS,EAI1E,EAAY,GAAoC,OAAO,GAAU,SACjE,EAAY,GAAoC,OAAO,GAAU,UAAY,CAAC,OAAO,MAAM,CAAK,EAChG,EAAa,GAAqC,OAAO,GAAU,UACnE,EAAqB,GAA8C,GAAS,KAC5E,EAAU,GAAkC,aAAiB,MAAQ,CAAC,OAAO,MAAM,EAAM,QAAQ,CAAC,EAClG,EAAW,GAAuC,MAAM,QAAQ,CAAK"}
1
+ {"version":3,"file":"validators.js","names":[],"sources":["../src/validators.ts"],"sourcesContent":["/**\n * Standalone validator functions: zero-dep, tree-shakeable helpers that return\n * a simple `boolean` (or a typed predicate) without constructing a Schema.\n * Useful in non-schema contexts such as conditional rendering, guards, etc.\n */\n\n/* -------------------- Generic range validators -------------------- */\n\nexport const hasMinLength = (value: string | unknown[], min: number): boolean => value.length >= min;\nexport const hasMaxLength = (value: string | unknown[], max: number): boolean => value.length <= max;\nexport const isInRange = (value: number, min: number, max: number): boolean => value >= min && value <= max;\nexport const isInteger = (value: number): boolean => Number.isInteger(value);\nexport const isPositive = (value: number): boolean => value > 0;\nexport const isNonNegative = (value: number): boolean => value >= 0;\nexport const isNegative = (value: number): boolean => value < 0;\nexport const isMultipleOf = (value: number, step: number): boolean => value % step === 0;\n\n/* -------------------- Type guards -------------------- */\n\nexport const isString = (value: unknown): value is string => typeof value === 'string';\nexport const isNumber = (value: unknown): value is number => typeof value === 'number' && !Number.isNaN(value);\nexport const isBoolean = (value: unknown): value is boolean => typeof value === 'boolean';\nexport const isNullOrUndefined = (value: unknown): value is null | undefined => value == null;\nexport const isDate = (value: unknown): value is Date => value instanceof Date && !Number.isNaN(value.getTime());\nexport const isArray = (value: unknown): value is unknown[] => Array.isArray(value);\n"],"mappings":"AAQA,IAAa,GAAgB,EAA2B,IAAyB,EAAM,QAAU,EACpF,GAAgB,EAA2B,IAAyB,EAAM,QAAU,EACpF,GAAa,EAAe,EAAa,IAAyB,GAAS,GAAO,GAAS,EAC3F,EAAa,GAA2B,OAAO,UAAU,CAAK,EAC9D,EAAc,GAA2B,EAAQ,EACjD,EAAiB,GAA2B,GAAS,EACrD,EAAc,GAA2B,EAAQ,EACjD,GAAgB,EAAe,IAA0B,EAAQ,IAAS,EAI1E,EAAY,GAAoC,OAAO,GAAU,SACjE,EAAY,GAAoC,OAAO,GAAU,UAAY,CAAC,OAAO,MAAM,CAAK,EAChG,EAAa,GAAqC,OAAO,GAAU,UACnE,EAAqB,GAA8C,GAAS,KAC5E,EAAU,GAAkC,aAAiB,MAAQ,CAAC,OAAO,MAAM,EAAM,QAAQ,CAAC,EAClG,EAAW,GAAuC,MAAM,QAAQ,CAAK"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vielzeug/spell",
3
- "version": "26.10.0",
3
+ "version": "26.10.1",
4
4
  "description": "Zero-dependency schema validation with Standard Schema interoperability",
5
5
  "repository": {
6
6
  "type": "git",
@@ -61,7 +61,7 @@
61
61
  "test:types": "tsc -p tsconfig.types.json"
62
62
  },
63
63
  "dependencies": {
64
- "@vielzeug/arsenal": "26.10.0"
64
+ "@vielzeug/arsenal": "26.10.1"
65
65
  },
66
66
  "devDependencies": {
67
67
  "@types/node": "^26.6.2",