@bastani/atomic-schema 0.0.0-placeholder.0 → 0.9.88-alpha.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.
- package/CHANGELOG.md +11 -0
- package/LICENSE +22 -0
- package/NOTICE.md +13 -0
- package/README.md +64 -0
- package/THIRD_PARTY_NOTICES/typebox-LICENSE +23 -0
- package/dist/annotations.d.ts +44 -0
- package/dist/annotations.d.ts.map +1 -0
- package/dist/annotations.js +193 -0
- package/dist/annotations.js.map +1 -0
- package/dist/builders.d.ts +143 -0
- package/dist/builders.d.ts.map +1 -0
- package/dist/builders.js +126 -0
- package/dist/builders.js.map +1 -0
- package/dist/checks.d.ts +114 -0
- package/dist/checks.d.ts.map +1 -0
- package/dist/checks.js +578 -0
- package/dist/checks.js.map +1 -0
- package/dist/coerce.d.ts +53 -0
- package/dist/coerce.d.ts.map +1 -0
- package/dist/coerce.js +624 -0
- package/dist/coerce.js.map +1 -0
- package/dist/compiler.d.ts +53 -0
- package/dist/compiler.d.ts.map +1 -0
- package/dist/compiler.js +551 -0
- package/dist/compiler.js.map +1 -0
- package/dist/explain.d.ts +29 -0
- package/dist/explain.d.ts.map +1 -0
- package/dist/explain.js +392 -0
- package/dist/explain.js.map +1 -0
- package/dist/formats/index.d.ts +7 -0
- package/dist/formats/index.d.ts.map +1 -0
- package/dist/formats/index.js +51 -0
- package/dist/formats/index.js.map +1 -0
- package/dist/formats/typebox/date.d.ts +7 -0
- package/dist/formats/typebox/date.d.ts.map +1 -0
- package/dist/formats/typebox/date.js +47 -0
- package/dist/formats/typebox/date.js.map +1 -0
- package/dist/formats/typebox/date_time.d.ts +7 -0
- package/dist/formats/typebox/date_time.d.ts.map +1 -0
- package/dist/formats/typebox/date_time.js +39 -0
- package/dist/formats/typebox/date_time.js.map +1 -0
- package/dist/formats/typebox/duration.d.ts +6 -0
- package/dist/formats/typebox/duration.d.ts.map +1 -0
- package/dist/formats/typebox/duration.js +36 -0
- package/dist/formats/typebox/duration.js.map +1 -0
- package/dist/formats/typebox/email.d.ts +6 -0
- package/dist/formats/typebox/email.d.ts.map +1 -0
- package/dist/formats/typebox/email.js +36 -0
- package/dist/formats/typebox/email.js.map +1 -0
- package/dist/formats/typebox/hostname.d.ts +8 -0
- package/dist/formats/typebox/hostname.d.ts.map +1 -0
- package/dist/formats/typebox/hostname.js +38 -0
- package/dist/formats/typebox/hostname.js.map +1 -0
- package/dist/formats/typebox/idn_email.d.ts +6 -0
- package/dist/formats/typebox/idn_email.d.ts.map +1 -0
- package/dist/formats/typebox/idn_email.js +36 -0
- package/dist/formats/typebox/idn_email.js.map +1 -0
- package/dist/formats/typebox/idn_hostname.d.ts +9 -0
- package/dist/formats/typebox/idn_hostname.d.ts.map +1 -0
- package/dist/formats/typebox/idn_hostname.js +39 -0
- package/dist/formats/typebox/idn_hostname.js.map +1 -0
- package/dist/formats/typebox/idna/format/bidi.d.ts +4 -0
- package/dist/formats/typebox/idna/format/bidi.d.ts.map +1 -0
- package/dist/formats/typebox/idna/format/bidi.js +132 -0
- package/dist/formats/typebox/idna/format/bidi.js.map +1 -0
- package/dist/formats/typebox/idna/format/puny.d.ts +4 -0
- package/dist/formats/typebox/idna/format/puny.d.ts.map +1 -0
- package/dist/formats/typebox/idna/format/puny.js +172 -0
- package/dist/formats/typebox/idna/format/puny.js.map +1 -0
- package/dist/formats/typebox/idna/hostname.d.ts +2 -0
- package/dist/formats/typebox/idna/hostname.d.ts.map +1 -0
- package/dist/formats/typebox/idna/hostname.js +43 -0
- package/dist/formats/typebox/idna/hostname.js.map +1 -0
- package/dist/formats/typebox/idna/idn-hostname.d.ts +2 -0
- package/dist/formats/typebox/idna/idn-hostname.d.ts.map +1 -0
- package/dist/formats/typebox/idna/idn-hostname.js +71 -0
- package/dist/formats/typebox/idna/idn-hostname.js.map +1 -0
- package/dist/formats/typebox/idna/index.d.ts +3 -0
- package/dist/formats/typebox/idna/index.d.ts.map +1 -0
- package/dist/formats/typebox/idna/index.js +30 -0
- package/dist/formats/typebox/idna/index.js.map +1 -0
- package/dist/formats/typebox/idna/label/ascii.d.ts +2 -0
- package/dist/formats/typebox/idna/label/ascii.d.ts.map +1 -0
- package/dist/formats/typebox/idna/label/ascii.js +37 -0
- package/dist/formats/typebox/idna/label/ascii.js.map +1 -0
- package/dist/formats/typebox/idna/label/puny.d.ts +2 -0
- package/dist/formats/typebox/idna/label/puny.d.ts.map +1 -0
- package/dist/formats/typebox/idna/label/puny.js +56 -0
- package/dist/formats/typebox/idna/label/puny.js.map +1 -0
- package/dist/formats/typebox/idna/label/unicode.d.ts +2 -0
- package/dist/formats/typebox/idna/label/unicode.d.ts.map +1 -0
- package/dist/formats/typebox/idna/label/unicode.js +134 -0
- package/dist/formats/typebox/idna/label/unicode.js.map +1 -0
- package/dist/formats/typebox/idna/pattern/pattern.d.ts +31 -0
- package/dist/formats/typebox/idna/pattern/pattern.d.ts.map +1 -0
- package/dist/formats/typebox/idna/pattern/pattern.js +98 -0
- package/dist/formats/typebox/idna/pattern/pattern.js.map +1 -0
- package/dist/formats/typebox/ipv4.d.ts +6 -0
- package/dist/formats/typebox/ipv4.d.ts.map +1 -0
- package/dist/formats/typebox/ipv4.js +36 -0
- package/dist/formats/typebox/ipv4.js.map +1 -0
- package/dist/formats/typebox/ipv6.d.ts +6 -0
- package/dist/formats/typebox/ipv6.d.ts.map +1 -0
- package/dist/formats/typebox/ipv6.js +36 -0
- package/dist/formats/typebox/ipv6.js.map +1 -0
- package/dist/formats/typebox/iri.d.ts +6 -0
- package/dist/formats/typebox/iri.d.ts.map +1 -0
- package/dist/formats/typebox/iri.js +63 -0
- package/dist/formats/typebox/iri.js.map +1 -0
- package/dist/formats/typebox/iri_reference.d.ts +6 -0
- package/dist/formats/typebox/iri_reference.d.ts.map +1 -0
- package/dist/formats/typebox/iri_reference.js +40 -0
- package/dist/formats/typebox/iri_reference.js.map +1 -0
- package/dist/formats/typebox/json_pointer.d.ts +7 -0
- package/dist/formats/typebox/json_pointer.d.ts.map +1 -0
- package/dist/formats/typebox/json_pointer.js +37 -0
- package/dist/formats/typebox/json_pointer.js.map +1 -0
- package/dist/formats/typebox/json_pointer_uri_fragment.d.ts +7 -0
- package/dist/formats/typebox/json_pointer_uri_fragment.d.ts.map +1 -0
- package/dist/formats/typebox/json_pointer_uri_fragment.js +37 -0
- package/dist/formats/typebox/json_pointer_uri_fragment.js.map +1 -0
- package/dist/formats/typebox/regex.d.ts +6 -0
- package/dist/formats/typebox/regex.d.ts.map +1 -0
- package/dist/formats/typebox/regex.js +41 -0
- package/dist/formats/typebox/regex.js.map +1 -0
- package/dist/formats/typebox/relative_json_pointer.d.ts +7 -0
- package/dist/formats/typebox/relative_json_pointer.d.ts.map +1 -0
- package/dist/formats/typebox/relative_json_pointer.js +37 -0
- package/dist/formats/typebox/relative_json_pointer.js.map +1 -0
- package/dist/formats/typebox/time.d.ts +6 -0
- package/dist/formats/typebox/time.d.ts.map +1 -0
- package/dist/formats/typebox/time.js +60 -0
- package/dist/formats/typebox/time.js.map +1 -0
- package/dist/formats/typebox/uri.d.ts +6 -0
- package/dist/formats/typebox/uri.d.ts.map +1 -0
- package/dist/formats/typebox/uri.js +36 -0
- package/dist/formats/typebox/uri.js.map +1 -0
- package/dist/formats/typebox/uri_reference.d.ts +6 -0
- package/dist/formats/typebox/uri_reference.d.ts.map +1 -0
- package/dist/formats/typebox/uri_reference.js +36 -0
- package/dist/formats/typebox/uri_reference.js.map +1 -0
- package/dist/formats/typebox/uri_template.d.ts +6 -0
- package/dist/formats/typebox/uri_template.d.ts.map +1 -0
- package/dist/formats/typebox/uri_template.js +37 -0
- package/dist/formats/typebox/uri_template.js.map +1 -0
- package/dist/formats/typebox/url.d.ts +7 -0
- package/dist/formats/typebox/url.d.ts.map +1 -0
- package/dist/formats/typebox/url.js +36 -0
- package/dist/formats/typebox/url.js.map +1 -0
- package/dist/formats/typebox/uuid.d.ts +7 -0
- package/dist/formats/typebox/uuid.d.ts.map +1 -0
- package/dist/formats/typebox/uuid.js +37 -0
- package/dist/formats/typebox/uuid.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/resolver.d.ts +58 -0
- package/dist/resolver.d.ts.map +1 -0
- package/dist/resolver.js +209 -0
- package/dist/resolver.js.map +1 -0
- package/dist/shared.d.ts +9 -0
- package/dist/shared.d.ts.map +1 -0
- package/dist/shared.js +33 -0
- package/dist/shared.js.map +1 -0
- package/dist/typebox-static.d.ts +56 -0
- package/dist/typebox-static.d.ts.map +1 -0
- package/dist/typebox-static.js +7 -0
- package/dist/typebox-static.js.map +1 -0
- package/dist/types.d.ts +48 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/validator.d.ts +48 -0
- package/dist/validator.d.ts.map +1 -0
- package/dist/validator.js +81 -0
- package/dist/validator.js.map +1 -0
- package/package.json +61 -8
package/dist/builders.js
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
// Schema builders: short functions that return plain JSON Schema objects and carry the static type of the values
|
|
2
|
+
// they accept, so `Static<typeof schema>` is the TypeScript type a valid value has. The objects are ordinary data:
|
|
3
|
+
// they serialize with JSON.stringify and compile with compile() like any other schema.
|
|
4
|
+
/** A string, with optional length bounds (in code points), pattern and format. */
|
|
5
|
+
export function str(options = {}) {
|
|
6
|
+
return { type: "string", ...options };
|
|
7
|
+
}
|
|
8
|
+
/** A number within optional bounds. */
|
|
9
|
+
export function num(options = {}) {
|
|
10
|
+
return { type: "number", ...options };
|
|
11
|
+
}
|
|
12
|
+
/** An integer within optional bounds. */
|
|
13
|
+
export function int(options = {}) {
|
|
14
|
+
return { type: "integer", ...options };
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A bigint within optional bounds (`{ type: "bigint" }`, as TypeBox's `Type.BigInt`): an extension of JSON Schema for
|
|
18
|
+
* values that never pass through JSON, such as 64-bit integers a Parquet reader decodes.
|
|
19
|
+
*/
|
|
20
|
+
export function bigint(options = {}) {
|
|
21
|
+
return { type: "bigint", ...options };
|
|
22
|
+
}
|
|
23
|
+
/** A boolean. */
|
|
24
|
+
export function bool(options = {}) {
|
|
25
|
+
return { type: "boolean", ...options };
|
|
26
|
+
}
|
|
27
|
+
/** `null`. */
|
|
28
|
+
export function nul(options = {}) {
|
|
29
|
+
return { type: "null", ...options };
|
|
30
|
+
}
|
|
31
|
+
/** Any value. */
|
|
32
|
+
export function unknown(options = {}) {
|
|
33
|
+
return { ...options };
|
|
34
|
+
}
|
|
35
|
+
/** Exactly `value` (a string, number, boolean or null). */
|
|
36
|
+
export function lit(value, options = {}) {
|
|
37
|
+
return { const: value, ...options };
|
|
38
|
+
}
|
|
39
|
+
/** One of the given values. */
|
|
40
|
+
export function oneOf(values, options = {}) {
|
|
41
|
+
return { enum: values, ...options };
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Any of the given schemas. A union of objects tagged by a `lit()` property (`{ kind: lit("text"), ... }`) is checked
|
|
45
|
+
* by the tag: only the branch it selects runs, and its errors are the ones reported.
|
|
46
|
+
*/
|
|
47
|
+
export function union(schemas, options = {}) {
|
|
48
|
+
return { anyOf: schemas, ...options };
|
|
49
|
+
}
|
|
50
|
+
/** `schema` or `null`. */
|
|
51
|
+
export function nullable(schema, options = {}) {
|
|
52
|
+
return { anyOf: [schema, { type: "null" }], ...options };
|
|
53
|
+
}
|
|
54
|
+
/** An array of `items`, with optional length bounds and unique items. */
|
|
55
|
+
export function arr(items, options = {}) {
|
|
56
|
+
return { type: "array", items, ...options };
|
|
57
|
+
}
|
|
58
|
+
/** A fixed-length array whose items match `items` in order. */
|
|
59
|
+
export function tuple(items, options = {}) {
|
|
60
|
+
return { type: "array", prefixItems: items, items: false, minItems: items.length, ...options };
|
|
61
|
+
}
|
|
62
|
+
/** An object with string keys and values of `value` (a record). */
|
|
63
|
+
export function map(value, options = {}) {
|
|
64
|
+
return { type: "object", additionalProperties: value, ...options };
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* `schema` typed as accepting `T`, for values the builders cannot express (a type checked elsewhere, a schema from
|
|
68
|
+
* another system). The schema is returned as it is: nothing checks that its values are `T`.
|
|
69
|
+
*/
|
|
70
|
+
export function unsafe(schema = {}) {
|
|
71
|
+
// The brand is type-level only; asserting it is what this builder is for.
|
|
72
|
+
return schema;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* A schema that contains itself, as a tree's children are trees: `build` receives a reference to the schema it
|
|
76
|
+
* returns. TypeScript cannot infer a recursive type from the builders, so `T` is given:
|
|
77
|
+
* `recursive<Tree>("Tree", (tree) => obj({ name: str(), children: arr(tree) }))`. `id` becomes the schema's `$id`
|
|
78
|
+
* and the target of the reference, so it must be unique among the recursive schemas within one schema.
|
|
79
|
+
*
|
|
80
|
+
* The counterpart of TypeBox's `Type.Cyclic` + `Type.Ref`, with other JSON: an `$id` on the schema instead of `$defs`
|
|
81
|
+
* and a root `$ref`. It validates the same values. The JSON differs only where a schema is published, and its type is
|
|
82
|
+
* written once instead of inferred, which a recursive schema (a file tree) needs only once.
|
|
83
|
+
*/
|
|
84
|
+
export function recursive(id, build) {
|
|
85
|
+
return { ...build({ $ref: id }), $id: id };
|
|
86
|
+
}
|
|
87
|
+
/** A Uint8Array with optional length bounds (an extension of JSON Schema for values that never pass through JSON). */
|
|
88
|
+
export function bytes(options = {}) {
|
|
89
|
+
return { type: "bytes", ...options };
|
|
90
|
+
}
|
|
91
|
+
/** An optional property of obj(): `{ name: opt(str()) }` may omit `name` or set it to undefined. */
|
|
92
|
+
export class Optional {
|
|
93
|
+
schema;
|
|
94
|
+
constructor(schema) {
|
|
95
|
+
this.schema = schema;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
/** Marks an obj() property as optional. */
|
|
99
|
+
export function opt(schema) {
|
|
100
|
+
return new Optional(schema);
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* A closed object: the given properties (required unless opt()) and no others. `open: true` allows other
|
|
104
|
+
* properties, as tool schemas from other systems often do.
|
|
105
|
+
*/
|
|
106
|
+
export function obj(properties, options = {}) {
|
|
107
|
+
const { open, ...annotations } = options;
|
|
108
|
+
const props = {};
|
|
109
|
+
const required = [];
|
|
110
|
+
for (const [name, property] of Object.entries(properties)) {
|
|
111
|
+
if (property instanceof Optional)
|
|
112
|
+
props[name] = property.schema;
|
|
113
|
+
else {
|
|
114
|
+
props[name] = property;
|
|
115
|
+
required.push(name);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return {
|
|
119
|
+
type: "object",
|
|
120
|
+
properties: props,
|
|
121
|
+
...(required.length > 0 ? { required } : {}),
|
|
122
|
+
...(open === true ? {} : { additionalProperties: false }),
|
|
123
|
+
...annotations,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=builders.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builders.js","sourceRoot":"","sources":["../src/builders.ts"],"names":[],"mappings":"AAAA,iHAAiH;AACjH,mHAAmH;AACnH,uFAAuF;AAwCvF,kFAAkF;AAClF,MAAM,UAAU,GAAG,CAClB,OAAO,GAAiG,EAAE;IAE1G,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,OAAO,EAAE,CAAC;AACvC,CAAC;AAWD,uCAAuC;AACvC,MAAM,UAAU,GAAG,CAAC,OAAO,GAAuC,EAAE;IACnE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,OAAO,EAAE,CAAC;AACvC,CAAC;AAED,yCAAyC;AACzC,MAAM,UAAU,GAAG,CAAC,OAAO,GAAuC,EAAE;IACnE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,OAAO,EAAE,CAAC;AACxC,CAAC;AAWD;;;GAGG;AACH,MAAM,UAAU,MAAM,CAAC,OAAO,GAAuC,EAAE;IACtE,OAAO,EAAE,IAA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GAA+D,EAAE;IAExE,MAAM,EAAE,IAAI,EAAE,GAAG,WAAW,EAAE,GAAG,OAAO,CAAC;IACzC,MAAM,KAAK,GAA2B,EAAE,CAAC;IACzC,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,KAAK,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;QAC3D,IAAI,QAAQ,YAAY,QAAQ;YAAE,KAAK,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC;aAC3D,CAAC;YACL,KAAK,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC;YACvB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACrB,CAAC;IACF,CAAC;IACD,OAAO;QACN,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,KAAK;QACjB,GAAG,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC5C,GAAG,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC;QACzD,GAAG,WAAW;KACd,CAAC;AACH,CAAC","sourcesContent":["// Schema builders: short functions that return plain JSON Schema objects and carry the static type of the values\n// they accept, so `Static<typeof schema>` is the TypeScript type a valid value has. The objects are ordinary data:\n// they serialize with JSON.stringify and compile with compile() like any other schema.\n\nimport type { TypeBoxStatic } from \"./typebox-static.ts\";\n\ndeclare const STATIC: unique symbol;\ndeclare const OPTIONAL_TYPE: unique symbol;\n\n/** A JSON Schema object whose valid values have type `T` (a type-level brand; nothing extra exists at run time). */\nexport type Schema<T = unknown> = { readonly [keyword: string]: unknown } & { readonly [STATIC]?: T };\n\n// TypeBox is tested first and in its own branch: a builder brand's fallback through TypeBoxStatic would leave\n// `Static<S>` of a generic `S` (constrained to builder schemas) unresolvable to its constraint's types.\n/**\n * The type of the values `S` accepts: the type a builder recorded; for a TypeBox schema (`'~kind'` or `'~unsafe'`),\n * TypeBox's static type for the common kinds (see `TypeBoxStatic`); else `unknown`.\n */\nexport type Static<S> = S extends { readonly \"~kind\": unknown } | { readonly \"~unsafe\": unknown }\n\t? TypeBoxStatic<S>\n\t: S extends { readonly [STATIC]?: infer T }\n\t\t? unknown extends T\n\t\t\t? unknown\n\t\t\t: T\n\t\t: unknown;\n\n/** Annotations every builder accepts: they describe the schema and never change what it accepts. */\nexport interface Annotations<T = unknown> {\n\treadonly title?: string;\n\treadonly description?: string;\n\treadonly examples?: readonly T[];\n\treadonly deprecated?: boolean;\n\t/** A default value, an annotation for tools and forms; validation never inserts it. */\n\treadonly default?: T;\n}\n\n/** Length bounds of a string, an array or bytes. */\nexport interface LengthBounds {\n\treadonly minLength?: number;\n\treadonly maxLength?: number;\n}\n\n/** A string, with optional length bounds (in code points), pattern and format. */\nexport function str(\n\toptions: Annotations<string> & LengthBounds & { readonly pattern?: string; readonly format?: string } = {},\n): Schema<string> {\n\treturn { type: \"string\", ...options };\n}\n\n/** Bounds of a number. */\nexport interface NumberBounds {\n\treadonly minimum?: number;\n\treadonly maximum?: number;\n\treadonly exclusiveMinimum?: number;\n\treadonly exclusiveMaximum?: number;\n\treadonly multipleOf?: number;\n}\n\n/** A number within optional bounds. */\nexport function num(options: Annotations<number> & NumberBounds = {}): Schema<number> {\n\treturn { type: \"number\", ...options };\n}\n\n/** An integer within optional bounds. */\nexport function int(options: Annotations<number> & NumberBounds = {}): Schema<number> {\n\treturn { type: \"integer\", ...options };\n}\n\n/** Bounds of a bigint: TypeBox's `Type.BigInt` options. */\nexport interface BigintBounds {\n\treadonly minimum?: bigint;\n\treadonly maximum?: bigint;\n\treadonly exclusiveMinimum?: bigint;\n\treadonly exclusiveMaximum?: bigint;\n\treadonly multipleOf?: bigint;\n}\n\n/**\n * A bigint within optional bounds (`{ type: \"bigint\" }`, as TypeBox's `Type.BigInt`): an extension of JSON Schema for\n * values that never pass through JSON, such as 64-bit integers a Parquet reader decodes.\n */\nexport function bigint(options: Annotations<bigint> & BigintBounds = {}): Schema<bigint> {\n\treturn { type: \"bigint\", ...options };\n}\n\n/** A boolean. */\nexport function bool(options: Annotations<boolean> = {}): Schema<boolean> {\n\treturn { type: \"boolean\", ...options };\n}\n\n/** `null`. */\nexport function nul(options: Annotations<null> = {}): Schema<null> {\n\treturn { type: \"null\", ...options };\n}\n\n/** Any value. */\nexport function unknown(options: Annotations = {}): Schema<unknown> {\n\treturn { ...options };\n}\n\n/** Exactly `value` (a string, number, boolean or null). */\nexport function lit<const V extends string | number | boolean | null>(\n\tvalue: V,\n\toptions: Annotations<V> = {},\n): Schema<V> {\n\treturn { const: value, ...options };\n}\n\n/** One of the given values. */\nexport function oneOf<const V extends readonly (string | number | boolean | null)[]>(\n\tvalues: V,\n\toptions: Annotations<V[number]> = {},\n): Schema<V[number]> {\n\treturn { enum: values, ...options };\n}\n\n/**\n * Any of the given schemas. A union of objects tagged by a `lit()` property (`{ kind: lit(\"text\"), ... }`) is checked\n * by the tag: only the branch it selects runs, and its errors are the ones reported.\n */\nexport function union<const S extends readonly Schema[]>(\n\tschemas: S,\n\toptions: Annotations<Static<S[number]>> = {},\n): Schema<Static<S[number]>> {\n\treturn { anyOf: schemas, ...options };\n}\n\n/** `schema` or `null`. */\nexport function nullable<T>(schema: Schema<T>, options: Annotations<T | null> = {}): Schema<T | null> {\n\treturn { anyOf: [schema, { type: \"null\" }], ...options };\n}\n\n/** An array of `items`, with optional length bounds and unique items. */\nexport function arr<T>(\n\titems: Schema<T>,\n\toptions: Annotations<T[]> & {\n\t\treadonly minItems?: number;\n\t\treadonly maxItems?: number;\n\t\treadonly uniqueItems?: boolean;\n\t} = {},\n): Schema<T[]> {\n\treturn { type: \"array\", items, ...options };\n}\n\n/** A fixed-length array whose items match `items` in order. */\nexport function tuple<const S extends readonly Schema[]>(\n\titems: S,\n\toptions: Annotations<{ -readonly [K in keyof S]: Static<S[K]> }> = {},\n): Schema<{ -readonly [K in keyof S]: Static<S[K]> }> {\n\treturn { type: \"array\", prefixItems: items, items: false, minItems: items.length, ...options };\n}\n\n/** An object with string keys and values of `value` (a record). */\nexport function map<T>(value: Schema<T>, options: Annotations<Record<string, T>> = {}): Schema<Record<string, T>> {\n\treturn { type: \"object\", additionalProperties: value, ...options };\n}\n\n/**\n * `schema` typed as accepting `T`, for values the builders cannot express (a type checked elsewhere, a schema from\n * another system). The schema is returned as it is: nothing checks that its values are `T`.\n */\nexport function unsafe<T>(schema: Schema = {}): Schema<T> {\n\t// The brand is type-level only; asserting it is what this builder is for.\n\treturn schema as Schema<T>;\n}\n\n/**\n * A schema that contains itself, as a tree's children are trees: `build` receives a reference to the schema it\n * returns. TypeScript cannot infer a recursive type from the builders, so `T` is given:\n * `recursive<Tree>(\"Tree\", (tree) => obj({ name: str(), children: arr(tree) }))`. `id` becomes the schema's `$id`\n * and the target of the reference, so it must be unique among the recursive schemas within one schema.\n *\n * The counterpart of TypeBox's `Type.Cyclic` + `Type.Ref`, with other JSON: an `$id` on the schema instead of `$defs`\n * and a root `$ref`. It validates the same values. The JSON differs only where a schema is published, and its type is\n * written once instead of inferred, which a recursive schema (a file tree) needs only once.\n */\nexport function recursive<T>(id: string, build: (self: Schema<T>) => Schema<T>): Schema<T> {\n\treturn { ...build({ $ref: id }), $id: id };\n}\n\n/** A Uint8Array with optional length bounds (an extension of JSON Schema for values that never pass through JSON). */\nexport function bytes(options: Annotations<Uint8Array> & LengthBounds = {}): Schema<Uint8Array> {\n\treturn { type: \"bytes\", ...options };\n}\n\n/** An optional property of obj(): `{ name: opt(str()) }` may omit `name` or set it to undefined. */\nexport class Optional<S extends Schema = Schema> {\n\tdeclare readonly [OPTIONAL_TYPE]?: S;\n\treadonly schema: S;\n\n\tconstructor(schema: S) {\n\t\tthis.schema = schema;\n\t}\n}\n\n/** Marks an obj() property as optional. */\nexport function opt<S extends Schema>(schema: S): Optional<S> {\n\treturn new Optional(schema);\n}\n\n/** The properties of obj(): a schema or an opt() schema per name. */\nexport type Properties = { readonly [name: string]: Schema | Optional };\n\n/** The value type of an obj() schema. */\nexport type StaticObject<P extends Properties> = Simplify<\n\t{ -readonly [K in keyof P as P[K] extends Optional ? never : K]: Static<P[K]> } & {\n\t\t-readonly [K in keyof P as P[K] extends Optional ? K : never]?: P[K] extends Optional<infer S>\n\t\t\t? Static<S>\n\t\t\t: never;\n\t}\n>;\n\ntype Simplify<T> = { [K in keyof T]: T[K] } & {};\n\n/**\n * A closed object: the given properties (required unless opt()) and no others. `open: true` allows other\n * properties, as tool schemas from other systems often do.\n */\nexport function obj<const P extends Properties>(\n\tproperties: P,\n\toptions: Annotations<StaticObject<P>> & { readonly open?: boolean } = {},\n): Schema<StaticObject<P>> {\n\tconst { open, ...annotations } = options;\n\tconst props: Record<string, Schema> = {};\n\tconst required: string[] = [];\n\tfor (const [name, property] of Object.entries(properties)) {\n\t\tif (property instanceof Optional) props[name] = property.schema;\n\t\telse {\n\t\t\tprops[name] = property;\n\t\t\trequired.push(name);\n\t\t}\n\t}\n\treturn {\n\t\ttype: \"object\",\n\t\tproperties: props,\n\t\t...(required.length > 0 ? { required } : {}),\n\t\t...(open === true ? {} : { additionalProperties: false }),\n\t\t...annotations,\n\t};\n}\n"]}
|
package/dist/checks.d.ts
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import type { Check } from "./types.ts";
|
|
2
|
+
export declare const ALWAYS: Check;
|
|
3
|
+
export declare const NEVER: Check;
|
|
4
|
+
export declare const IS_ARRAY: Check;
|
|
5
|
+
export declare const IS_OBJECT: Check;
|
|
6
|
+
/** Whether `v` is a JSON object: not null, an array or bytes. */
|
|
7
|
+
export declare function isObject(v: unknown): v is Record<string, unknown>;
|
|
8
|
+
/**
|
|
9
|
+
* The check of a `type` name. `bytes` (a Uint8Array), `bigint` (TypeBox's `Type.BigInt`) and `undefined` (TypeBox's
|
|
10
|
+
* `Type.Undefined`) extend JSON Schema for values that never pass through JSON. A `number` is finite, as in TypeBox:
|
|
11
|
+
* JSON has no NaN or Infinity, so only a value built in code can be one.
|
|
12
|
+
*/
|
|
13
|
+
export declare const TYPE_CHECKS: ReadonlyMap<string, Check>;
|
|
14
|
+
/**
|
|
15
|
+
* A leaf check as a code and its argument, which object and array loops run by `leafOk` instead of calling the
|
|
16
|
+
* check: a call through a list of checks is not inlined, a switch is.
|
|
17
|
+
*/
|
|
18
|
+
export type Leaf = readonly [code: number, arg: unknown];
|
|
19
|
+
/** The leaf form of `check`, undefined when it is not a leaf. */
|
|
20
|
+
export declare function leafOf(check: Check): Leaf | undefined;
|
|
21
|
+
/** Whether a combined object or array check also checks the type: not at all, strictly, or passing other types. */
|
|
22
|
+
export declare const GUARD_NONE = 0;
|
|
23
|
+
export declare const GUARD_STRICT = 1;
|
|
24
|
+
export declare const GUARD_LOOSE = 2;
|
|
25
|
+
export type Guard = typeof GUARD_NONE | typeof GUARD_STRICT | typeof GUARD_LOOSE;
|
|
26
|
+
/** Flags of a declared property in an object check's entries: its leaf code and two bits. */
|
|
27
|
+
export declare const CODE = 15;
|
|
28
|
+
export declare const REQUIRED = 16;
|
|
29
|
+
export declare const INHERITED = 32;
|
|
30
|
+
/** All of `parts`; two and three parts get closures without a loop. */
|
|
31
|
+
export declare function and(parts: readonly Check[]): Check;
|
|
32
|
+
/** A check whose implementation is set later: the indirection a recursive reference goes through. */
|
|
33
|
+
export declare function indirect(slot: {
|
|
34
|
+
check: Check | undefined;
|
|
35
|
+
}): Check;
|
|
36
|
+
/** `check` with `uri` pushed onto the dynamic scope while it runs (only for schemas with `$dynamicRef`). */
|
|
37
|
+
export declare function scopedCheck(scope: string[], uri: string, check: Check): Check;
|
|
38
|
+
/** Any of the named types. */
|
|
39
|
+
export declare function typeCheck(types: readonly unknown[]): Check;
|
|
40
|
+
/** The bits of the named types; unknown names add none. */
|
|
41
|
+
export declare function typeMask(types: readonly unknown[]): number;
|
|
42
|
+
/** `anyOf` whose bare-type branches have the types of `mask`: those by one type test, the others by their checks. */
|
|
43
|
+
export declare function maskedAnyCheck(mask: number, checks: readonly Check[]): Check;
|
|
44
|
+
/** A Uint8Array within the length bounds. */
|
|
45
|
+
export declare function bytesCheck(min: number, max: number): Check;
|
|
46
|
+
/** The number of Unicode code points of `s`: JSON Schema string lengths count code points, not UTF-16 units. */
|
|
47
|
+
export declare function codePoints(s: string): number;
|
|
48
|
+
/** The string keywords: length bounds, pattern and format. */
|
|
49
|
+
export declare function stringCheck(strict: boolean, min: number, max: number, re: RegExp | undefined, format: ((value: string) => boolean) | undefined): Check;
|
|
50
|
+
/** A number bound: a number, or a bigint (TypeBox's `Type.BigInt` writes its bounds as bigints). */
|
|
51
|
+
export type Bound = number | bigint;
|
|
52
|
+
/**
|
|
53
|
+
* The number keywords, for numbers and bigints alike (as TypeBox applies them): bounds of either kind compare with
|
|
54
|
+
* values of either kind. `mode`: 0 passes other types, 1 requires a number, 2 an integer, 3 a bigint.
|
|
55
|
+
*/
|
|
56
|
+
export declare function numberCheck(mode: 0 | 1 | 2 | 3, min: Bound, max: Bound, xmin: Bound, xmax: Bound, multipleOf: Bound | undefined): Check;
|
|
57
|
+
/**
|
|
58
|
+
* Whether `v` is a multiple of `d`, exactly for decimals: 0.0075 / 0.0001 is 74.99999999999999 in floating point. With
|
|
59
|
+
* a bigint on either side, exact integer arithmetic; a bigint is no multiple of 0 or of a fraction.
|
|
60
|
+
*
|
|
61
|
+
* Deliberately unlike TypeBox, which throws there (`BigInt(0.5)`, division by zero): a check answers for every value
|
|
62
|
+
* and never throws, and no real schema pairs a bigint with a fractional or zero `multipleOf`.
|
|
63
|
+
*/
|
|
64
|
+
export declare function isMultiple(v: Bound, d: Bound): boolean;
|
|
65
|
+
/** `inner` for objects; other values pass unless `strict`. */
|
|
66
|
+
export declare function guardObject(inner: Check, strict: boolean): Check;
|
|
67
|
+
/** `inner` for arrays; other values pass unless `strict`. */
|
|
68
|
+
export declare function guardArray(inner: Check, strict: boolean): Check;
|
|
69
|
+
/**
|
|
70
|
+
* An object with declared properties: `entries` is `[key, check, flags]` per property. The value's own keys are
|
|
71
|
+
* walked with for...in (whose `o[k]` V8 reads from the enum cache, unlike a load by a name from a list), each found
|
|
72
|
+
* among the declared names; `closed` rejects any other key. A property whose value is `undefined` counts as absent.
|
|
73
|
+
*/
|
|
74
|
+
export declare function declaredObject(entries: readonly unknown[], requiredCount: number, closed: boolean, guard: Guard): Check;
|
|
75
|
+
/** An object with declared properties, required keys not declared, pattern properties and additional properties. */
|
|
76
|
+
export declare function openObject(entries: readonly unknown[], keys: readonly string[], extraRequired: readonly string[], patterns: readonly (readonly [RegExp, Check])[], additional: Check | undefined, guard: Guard): Check;
|
|
77
|
+
/** Every property name passes `check` (`v` is an object). */
|
|
78
|
+
export declare function propertyNamesCheck(check: Check): Check;
|
|
79
|
+
/** `minProperties` and `maxProperties` (`v` is an object). */
|
|
80
|
+
export declare function propertyCountCheck(min: number, max: number): Check;
|
|
81
|
+
/** `dependentRequired` (`v` is an object). */
|
|
82
|
+
export declare function dependentRequiredCheck(entries: readonly (readonly [string, readonly string[]])[]): Check;
|
|
83
|
+
/** `dependentSchemas` (`v` is an object). */
|
|
84
|
+
export declare function dependentSchemasCheck(entries: readonly (readonly [string, Check])[]): Check;
|
|
85
|
+
/** The common array: guard, length bounds, prefix items and the items after them, in one closure. */
|
|
86
|
+
export declare function listCheck(guard: Guard, min: number, max: number, prefix: readonly Check[], rest: Check | undefined): Check;
|
|
87
|
+
/** Prefix items and the items after them (`v` is an array). */
|
|
88
|
+
export declare function itemsCheck(prefix: readonly Check[], rest: Check | undefined): Check;
|
|
89
|
+
/** `minItems` and `maxItems` (`v` is an array). */
|
|
90
|
+
export declare function lengthCheck(min: number, max: number): Check;
|
|
91
|
+
/** `contains` with its bounds (`v` is an array). */
|
|
92
|
+
export declare function containsCheck(check: Check, min: number, max: number): Check;
|
|
93
|
+
/** `uniqueItems` (`v` is an array). */
|
|
94
|
+
export declare function uniqueCheck(v: unknown): boolean;
|
|
95
|
+
/** `enum`: up to 8 primitives by a scan, more by a Set, objects and arrays by deep equality. */
|
|
96
|
+
export declare function enumCheck(values: readonly unknown[]): Check;
|
|
97
|
+
/** `const`. */
|
|
98
|
+
export declare function constCheck(value: unknown): Check;
|
|
99
|
+
/** `anyOf`. */
|
|
100
|
+
export declare function anyCheck(checks: readonly Check[]): Check;
|
|
101
|
+
/** `oneOf`. */
|
|
102
|
+
export declare function oneCheck(checks: readonly Check[]): Check;
|
|
103
|
+
/** `not`. */
|
|
104
|
+
export declare function notCheck(check: Check): Check;
|
|
105
|
+
/** `if`, `then` and `else`. */
|
|
106
|
+
export declare function ifCheck(cond: Check, then: Check, otherwise: Check): Check;
|
|
107
|
+
/** A union of objects tagged by a const on `key`: the tag selects the one branch that can match. */
|
|
108
|
+
export declare function taggedCheck(key: string, tags: readonly unknown[], checks: readonly Check[]): Check;
|
|
109
|
+
/**
|
|
110
|
+
* JSON equality, as `const`, `enum` and `uniqueItems` compare: the same primitives, arrays with equal items in order,
|
|
111
|
+
* objects with the same keys and equal values (key order does not matter).
|
|
112
|
+
*/
|
|
113
|
+
export declare function deepEqual(a: unknown, b: unknown): boolean;
|
|
114
|
+
//# sourceMappingURL=checks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checks.d.ts","sourceRoot":"","sources":["../src/checks.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC,eAAO,MAAM,MAAM,EAAE,KAAkB,CAAC;AACxC,eAAO,MAAM,KAAK,EAAE,KAAmB,CAAC;AAMxC,eAAO,MAAM,QAAQ,EAAE,KAA+B,CAAC;AAIvD,eAAO,MAAM,SAAS,EAAE,KAA0B,CAAC;AAEnD,iEAAiE;AACjE,wBAAgB,QAAQ,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAA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