Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | /** A path segment of a Standard Schema issue. */
export type StandardSchemaPathSegment = Readonly<{
/** Key of the segment. */
key: PropertyKey;
}>;
/** One problem reported by a Standard Schema validator. */
export type StandardSchemaIssue = Readonly<{
/** Error message. */
message: string;
/** Location of the problem inside the validated value. */
path?: readonly (PropertyKey | StandardSchemaPathSegment)[];
}>;
/** Result of Standard Schema validation. */
export type StandardSchemaResult =
| Readonly<{
/** Validated (possibly transformed) value. */
value: unknown;
/** Absent on success. */
issues?: undefined;
}>
| Readonly<{
/** Problems found. */
issues: readonly StandardSchemaIssue[];
}>;
/** The `~standard` property of a Standard Schema v1 object. */
export type StandardSchemaProps = Readonly<{
/** Standard Schema version. */
version: 1;
/** Library name, e.g. `'zod'`. */
vendor: string;
/** Validates a value. */
validate: (value: unknown) => StandardSchemaResult | Promise<StandardSchemaResult>;
}>;
/**
* Any schema implementing [Standard Schema v1](https://standardschema.dev) — zod, valibot, arktype
* and others. Used by `validate: { schema }` on attributes and `schema` on models.
*/
export type StandardSchemaV1 = Readonly<{
/** Standard Schema interface. */
'~standard': StandardSchemaProps;
}>;
|