@powerlines/schema 0.11.71 → 0.11.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2111 -97
- package/dist/index.d.cts +1841 -11
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +1841 -13
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1999 -15
- package/dist/index.mjs.map +1 -0
- package/package.json +14 -14
- package/dist/_virtual/_rolldown/runtime.cjs +0 -37
- package/dist/bundle.cjs +0 -55
- package/dist/bundle.d.cts +0 -21
- package/dist/bundle.d.cts.map +0 -1
- package/dist/bundle.d.mts +0 -23
- package/dist/bundle.d.mts.map +0 -1
- package/dist/bundle.mjs +0 -54
- package/dist/bundle.mjs.map +0 -1
- package/dist/codegen.cjs +0 -81
- package/dist/codegen.d.cts +0 -26
- package/dist/codegen.d.cts.map +0 -1
- package/dist/codegen.d.mts +0 -28
- package/dist/codegen.d.mts.map +0 -1
- package/dist/codegen.mjs +0 -77
- package/dist/codegen.mjs.map +0 -1
- package/dist/constants.cjs +0 -69
- package/dist/constants.d.cts +0 -17
- package/dist/constants.d.cts.map +0 -1
- package/dist/constants.d.mts +0 -19
- package/dist/constants.d.mts.map +0 -1
- package/dist/constants.mjs +0 -65
- package/dist/constants.mjs.map +0 -1
- package/dist/extract.cjs +0 -490
- package/dist/extract.d.cts +0 -125
- package/dist/extract.d.cts.map +0 -1
- package/dist/extract.d.mts +0 -127
- package/dist/extract.d.mts.map +0 -1
- package/dist/extract.mjs +0 -480
- package/dist/extract.mjs.map +0 -1
- package/dist/helpers.cjs +0 -171
- package/dist/helpers.d.cts +0 -111
- package/dist/helpers.d.cts.map +0 -1
- package/dist/helpers.d.mts +0 -113
- package/dist/helpers.d.mts.map +0 -1
- package/dist/helpers.mjs +0 -164
- package/dist/helpers.mjs.map +0 -1
- package/dist/metadata.cjs +0 -61
- package/dist/metadata.d.cts +0 -31
- package/dist/metadata.d.cts.map +0 -1
- package/dist/metadata.d.mts +0 -33
- package/dist/metadata.d.mts.map +0 -1
- package/dist/metadata.mjs +0 -60
- package/dist/metadata.mjs.map +0 -1
- package/dist/persistence.cjs +0 -82
- package/dist/persistence.d.cts +0 -47
- package/dist/persistence.d.cts.map +0 -1
- package/dist/persistence.d.mts +0 -49
- package/dist/persistence.d.mts.map +0 -1
- package/dist/persistence.mjs +0 -79
- package/dist/persistence.mjs.map +0 -1
- package/dist/reflection.cjs +0 -434
- package/dist/reflection.d.cts +0 -11
- package/dist/reflection.d.cts.map +0 -1
- package/dist/reflection.d.mts +0 -13
- package/dist/reflection.d.mts.map +0 -1
- package/dist/reflection.mjs +0 -433
- package/dist/reflection.mjs.map +0 -1
- package/dist/resolve.cjs +0 -113
- package/dist/resolve.d.cts +0 -36
- package/dist/resolve.d.cts.map +0 -1
- package/dist/resolve.d.mts +0 -38
- package/dist/resolve.d.mts.map +0 -1
- package/dist/resolve.mjs +0 -110
- package/dist/resolve.mjs.map +0 -1
- package/dist/type-checks.cjs +0 -642
- package/dist/type-checks.d.cts +0 -316
- package/dist/type-checks.d.cts.map +0 -1
- package/dist/type-checks.d.mts +0 -318
- package/dist/type-checks.d.mts.map +0 -1
- package/dist/type-checks.mjs +0 -603
- package/dist/type-checks.mjs.map +0 -1
- package/dist/types.d.cts +0 -1152
- package/dist/types.d.cts.map +0 -1
- package/dist/types.d.mts +0 -1154
- package/dist/types.d.mts.map +0 -1
- package/dist/validate.cjs +0 -35
- package/dist/validate.mjs +0 -33
- package/dist/validate.mjs.map +0 -1
package/dist/type-checks.d.cts
DELETED
|
@@ -1,316 +0,0 @@
|
|
|
1
|
-
import { ExtractedSchema, JsonSchema, JsonSchemaAllOf, JsonSchemaAny, JsonSchemaAnyOf, JsonSchemaArray, JsonSchemaBigint, JsonSchemaBoolean, JsonSchemaDate, JsonSchemaDecimal, JsonSchemaEnum, JsonSchemaInteger, JsonSchemaKeywords, JsonSchemaLiteral, JsonSchemaMap, JsonSchemaNativeEnum, JsonSchemaNever, JsonSchemaNull, JsonSchemaNullable, JsonSchemaNumber, JsonSchemaObject, JsonSchemaPrimitiveType, JsonSchemaPrimitiveUnion, JsonSchemaRecord, JsonSchemaRef, JsonSchemaSet, JsonSchemaString, JsonSchemaTuple, JsonSchemaType, JsonSchemaUndefined, JsonSchemaUnion, JsonSchemaUnknown, Schema as Schema$1 } from "./types.cjs";
|
|
2
|
-
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
3
|
-
import { InputObject, Schema } from "untyped";
|
|
4
|
-
import { BaseSchema } from "valibot";
|
|
5
|
-
|
|
6
|
-
//#region src/type-checks.d.ts
|
|
7
|
-
/**
|
|
8
|
-
* A helper type guard to check if a value is a JSON Schema primitive type.
|
|
9
|
-
*
|
|
10
|
-
* @param value - The value to check.
|
|
11
|
-
* @returns True if the value is a JSON Schema primitive type, false otherwise.
|
|
12
|
-
*/
|
|
13
|
-
declare function isJsonSchemaPrimitiveType(value: unknown): value is JsonSchemaPrimitiveType;
|
|
14
|
-
/**
|
|
15
|
-
* A helper type guard to check if a value is a JSON Schema type.
|
|
16
|
-
*
|
|
17
|
-
* @param value - The value to check.
|
|
18
|
-
* @returns True if the value is a JSON Schema type, false otherwise.
|
|
19
|
-
*/
|
|
20
|
-
declare function isJsonSchemaType(value: unknown): value is JsonSchemaType;
|
|
21
|
-
/**
|
|
22
|
-
* Type guard for shared JSON Schema keyword groups.
|
|
23
|
-
*
|
|
24
|
-
* @param input - The value to check.
|
|
25
|
-
* @returns True if the input is a JSON Schema keyword group, false otherwise.
|
|
26
|
-
*/
|
|
27
|
-
declare function isJsonSchemaKeywords(input: unknown): input is JsonSchemaKeywords;
|
|
28
|
-
/**
|
|
29
|
-
* Type guard for generic JSON Schema objects with optional `$ref`.
|
|
30
|
-
*
|
|
31
|
-
* @param input - The value to check.
|
|
32
|
-
* @returns True if the input is a generic JSON Schema object, false otherwise.
|
|
33
|
-
*/
|
|
34
|
-
declare function isJsonSchemaAny(input: unknown): input is JsonSchemaAny;
|
|
35
|
-
/**
|
|
36
|
-
* Type guard for JSON Schema array types.
|
|
37
|
-
*
|
|
38
|
-
* @param input - The value to check.
|
|
39
|
-
* @returns True if the input is a JSON Schema array schema, false otherwise.
|
|
40
|
-
*/
|
|
41
|
-
declare function isJsonSchemaArray(input: unknown): input is JsonSchemaArray;
|
|
42
|
-
/**
|
|
43
|
-
* Type guard for bigint-backed integer schemas.
|
|
44
|
-
*
|
|
45
|
-
* @param input - The value to check.
|
|
46
|
-
* @returns True if the input is a bigint-backed integer schema, false otherwise.
|
|
47
|
-
*/
|
|
48
|
-
declare function isJsonSchemaBigint(input: unknown): input is JsonSchemaBigint;
|
|
49
|
-
/**
|
|
50
|
-
* Type guard for boolean schemas.
|
|
51
|
-
*
|
|
52
|
-
* @param input - The value to check.
|
|
53
|
-
* @returns True if the input is a boolean schema, false otherwise.
|
|
54
|
-
*/
|
|
55
|
-
declare function isJsonSchemaBoolean(input: unknown): input is JsonSchemaBoolean;
|
|
56
|
-
/**
|
|
57
|
-
* Type guard for date/time schemas.
|
|
58
|
-
*
|
|
59
|
-
* @param input - The value to check.
|
|
60
|
-
* @returns True if the input is a date or time schema, false otherwise.
|
|
61
|
-
*/
|
|
62
|
-
declare function isJsonSchemaDate(input: unknown): input is JsonSchemaDate;
|
|
63
|
-
/**
|
|
64
|
-
* Type guard for enum-constrained schemas.
|
|
65
|
-
*
|
|
66
|
-
* @param input - The value to check.
|
|
67
|
-
* @returns True if the input is an enum-constrained schema, false otherwise.
|
|
68
|
-
*/
|
|
69
|
-
declare function isJsonSchemaEnum(input: unknown): input is JsonSchemaEnum;
|
|
70
|
-
/**
|
|
71
|
-
* Type guard for `allOf` composition schemas.
|
|
72
|
-
*
|
|
73
|
-
* @param input - The value to check.
|
|
74
|
-
* @returns True if the input is an `allOf` schema, false otherwise.
|
|
75
|
-
*/
|
|
76
|
-
declare function isJsonSchemaAllOf(input: unknown): input is JsonSchemaAllOf;
|
|
77
|
-
/**
|
|
78
|
-
* Type guard for literal-value schemas.
|
|
79
|
-
*
|
|
80
|
-
* @param input - The value to check.
|
|
81
|
-
* @returns True if the input is a literal-value schema, false otherwise.
|
|
82
|
-
*/
|
|
83
|
-
declare function isJsonSchemaLiteral(input: unknown): input is JsonSchemaLiteral;
|
|
84
|
-
/**
|
|
85
|
-
* Type guard for map tuple-array schemas.
|
|
86
|
-
*
|
|
87
|
-
* @param input - The value to check.
|
|
88
|
-
* @returns True if the input is a map tuple-array schema, false otherwise.
|
|
89
|
-
*/
|
|
90
|
-
declare function isJsonSchemaMap(input: unknown): input is JsonSchemaMap;
|
|
91
|
-
/**
|
|
92
|
-
* Type guard for native enum schemas.
|
|
93
|
-
*
|
|
94
|
-
* @param input - The value to check.
|
|
95
|
-
* @returns True if the input is a native enum schema, false otherwise.
|
|
96
|
-
*/
|
|
97
|
-
declare function isJsonSchemaNativeEnum(input: unknown): input is JsonSchemaNativeEnum;
|
|
98
|
-
/**
|
|
99
|
-
* Type guard for impossible/never schemas.
|
|
100
|
-
*
|
|
101
|
-
* @param input - The value to check.
|
|
102
|
-
* @returns True if the input is a never schema, false otherwise.
|
|
103
|
-
*/
|
|
104
|
-
declare function isJsonSchemaNever(input: unknown): input is JsonSchemaNever;
|
|
105
|
-
/**
|
|
106
|
-
* Type guard for `null` schemas.
|
|
107
|
-
*
|
|
108
|
-
* @param input - The value to check.
|
|
109
|
-
* @returns True if the input is a null schema, false otherwise.
|
|
110
|
-
*/
|
|
111
|
-
declare function isJsonSchemaNull(input: unknown): input is JsonSchemaNull;
|
|
112
|
-
/**
|
|
113
|
-
* Type guard for nullable schema unions.
|
|
114
|
-
*
|
|
115
|
-
* @param input - The value to check.
|
|
116
|
-
* @returns True if the input is a nullable schema union, false otherwise.
|
|
117
|
-
*/
|
|
118
|
-
declare function isJsonSchemaNullable(input: unknown): input is JsonSchemaNullable;
|
|
119
|
-
/**
|
|
120
|
-
* Type guard for numeric schemas.
|
|
121
|
-
*
|
|
122
|
-
* @param input - The value to check.
|
|
123
|
-
* @returns True if the input is a numeric schema, false otherwise.
|
|
124
|
-
*/
|
|
125
|
-
declare function isJsonSchemaNumber(input: unknown): input is JsonSchemaNumber;
|
|
126
|
-
/**
|
|
127
|
-
* Type guard for integer schemas.
|
|
128
|
-
*
|
|
129
|
-
* @param input - The value to check.
|
|
130
|
-
* @returns True if the input is an integer schema, false otherwise.
|
|
131
|
-
*/
|
|
132
|
-
declare function isJsonSchemaInteger(input: unknown): input is JsonSchemaInteger;
|
|
133
|
-
/**
|
|
134
|
-
* Type guard for decimal schemas.
|
|
135
|
-
*
|
|
136
|
-
* @param input - The value to check.
|
|
137
|
-
* @returns True if the input is a decimal schema, false otherwise.
|
|
138
|
-
*/
|
|
139
|
-
declare function isJsonSchemaDecimal(input: unknown): input is JsonSchemaDecimal;
|
|
140
|
-
/**
|
|
141
|
-
* Type guard for object schemas.
|
|
142
|
-
*
|
|
143
|
-
* @param input - The value to check.
|
|
144
|
-
* @returns True if the input is an object schema, false otherwise.
|
|
145
|
-
*/
|
|
146
|
-
declare function isJsonSchemaObject(input: unknown): input is JsonSchemaObject;
|
|
147
|
-
/**
|
|
148
|
-
* Type guard for string schemas.
|
|
149
|
-
*
|
|
150
|
-
* @param input - The value to check.
|
|
151
|
-
* @returns True if the input is a string schema, false otherwise.
|
|
152
|
-
*/
|
|
153
|
-
declare function isJsonSchemaString(input: unknown): input is JsonSchemaString;
|
|
154
|
-
/**
|
|
155
|
-
* Type guard for set-like array schemas.
|
|
156
|
-
*
|
|
157
|
-
* @param input - The value to check.
|
|
158
|
-
* @returns True if the input is a set-like array schema, false otherwise.
|
|
159
|
-
*/
|
|
160
|
-
declare function isJsonSchemaSet(input: unknown): input is JsonSchemaSet;
|
|
161
|
-
/**
|
|
162
|
-
* Type guard for record schemas.
|
|
163
|
-
*
|
|
164
|
-
* @param input - The value to check.
|
|
165
|
-
* @returns True if the input is a record schema, false otherwise.
|
|
166
|
-
*/
|
|
167
|
-
declare function isJsonSchemaRecord(input: unknown): input is JsonSchemaRecord;
|
|
168
|
-
/**
|
|
169
|
-
* Type guard for tuple schemas.
|
|
170
|
-
*
|
|
171
|
-
* @param input - The value to check.
|
|
172
|
-
* @returns True if the input is a tuple schema, false otherwise.
|
|
173
|
-
*/
|
|
174
|
-
declare function isJsonSchemaTuple(input: unknown): input is JsonSchemaTuple;
|
|
175
|
-
/**
|
|
176
|
-
* Type guard for undefined-representing schemas.
|
|
177
|
-
*
|
|
178
|
-
* @param input - The value to check.
|
|
179
|
-
* @returns True if the input is an undefined-representing schema, false otherwise.
|
|
180
|
-
*/
|
|
181
|
-
declare function isJsonSchemaUndefined(input: unknown): input is JsonSchemaUndefined;
|
|
182
|
-
/**
|
|
183
|
-
* Type guard for primitive-union schema variants.
|
|
184
|
-
*
|
|
185
|
-
* @param input - The value to check.
|
|
186
|
-
* @returns True if the input is a primitive-union schema variant, false otherwise.
|
|
187
|
-
*/
|
|
188
|
-
declare function isJsonSchemaPrimitiveUnion(input: unknown): input is JsonSchemaPrimitiveUnion;
|
|
189
|
-
/**
|
|
190
|
-
* Type guard for union schemas.
|
|
191
|
-
*
|
|
192
|
-
* @param input - The value to check.
|
|
193
|
-
* @returns True if the input is a union schema, false otherwise.
|
|
194
|
-
*/
|
|
195
|
-
declare function isJsonSchemaUnion(input: unknown): input is JsonSchemaUnion;
|
|
196
|
-
/**
|
|
197
|
-
* Type guard for permissive unknown schemas.
|
|
198
|
-
*
|
|
199
|
-
* @param input - The value to check.
|
|
200
|
-
* @returns True if the input is a permissive unknown schema, false otherwise.
|
|
201
|
-
*/
|
|
202
|
-
declare function isJsonSchemaUnknown(input: unknown): input is JsonSchemaUnknown;
|
|
203
|
-
/**
|
|
204
|
-
* Type guard for `anyOf` composition schemas.
|
|
205
|
-
*
|
|
206
|
-
* @param input - The value to check.
|
|
207
|
-
* @returns True if the input is an `anyOf` schema, false otherwise.
|
|
208
|
-
*/
|
|
209
|
-
declare function isJsonSchemaAnyOf(input: unknown): input is JsonSchemaAnyOf;
|
|
210
|
-
/**
|
|
211
|
-
* Type guard for reference schemas.
|
|
212
|
-
*
|
|
213
|
-
* @param input - The value to check.
|
|
214
|
-
* @returns True if the input is a reference schema, false otherwise.
|
|
215
|
-
*/
|
|
216
|
-
declare function isJsonSchemaRef(input: unknown): input is JsonSchemaRef;
|
|
217
|
-
/**
|
|
218
|
-
* Type guard for Standard Schema V1 objects.
|
|
219
|
-
*
|
|
220
|
-
* @param input - The value to check.
|
|
221
|
-
* @returns True if the input is a Standard Schema V1 object, false otherwise.
|
|
222
|
-
*/
|
|
223
|
-
declare function isStandardSchema(input: unknown): input is StandardSchemaV1;
|
|
224
|
-
/**
|
|
225
|
-
* Type guard for Valibot BaseSchema objects.
|
|
226
|
-
*
|
|
227
|
-
* @param input - The value to check.
|
|
228
|
-
* @returns True if the input is a Valibot BaseSchema, false otherwise.
|
|
229
|
-
*/
|
|
230
|
-
declare function isValibotSchema(input: unknown): input is BaseSchema<any, any, any>;
|
|
231
|
-
/**
|
|
232
|
-
* Type guard for JSON Schema types.
|
|
233
|
-
*
|
|
234
|
-
* @remarks
|
|
235
|
-
* This function checks if the input is a JSON Schema type, which is defined as having a `type` property or a `$ref` property. This is used to determine if a given input conforms to the structure of a JSON Schema definition that includes type information.
|
|
236
|
-
*
|
|
237
|
-
* @param input - The value to check.
|
|
238
|
-
* @returns True if the input is a JSON Schema type, false otherwise.
|
|
239
|
-
*/
|
|
240
|
-
declare function isJsonSchema(input: unknown): input is JsonSchema;
|
|
241
|
-
/**
|
|
242
|
-
* Type guard for JSON Schemas that only accept `null`.
|
|
243
|
-
*
|
|
244
|
-
* @remarks
|
|
245
|
-
* This function checks if the input is a JSON Schema that exclusively accepts the `null` type. It verifies that the input is a valid JSON Schema and that its `type` property is set to "null". This is useful for identifying schemas that are specifically designed to allow only `null` values.
|
|
246
|
-
*
|
|
247
|
-
* @param input - The value to check.
|
|
248
|
-
* @returns True if the input is a JSON Schema that only accepts `null`, false otherwise.
|
|
249
|
-
*/
|
|
250
|
-
declare function isNullOnlyJsonSchema(input: unknown): input is JsonSchemaNull;
|
|
251
|
-
/**
|
|
252
|
-
* Type guard for untyped schema objects.
|
|
253
|
-
*
|
|
254
|
-
* @remarks
|
|
255
|
-
* This function checks if the input is an untyped schema object, which is defined as having certain properties that are commonly found in untyped schema definitions. This includes properties such as `id`, `title`, `description`, `$schema`, `tsType`, `markdownType`, `type`, `required`, `tags`, `args`, `properties`, and `resolve`. The function verifies that these properties, if present, conform to the expected types (e.g., strings for certain properties, arrays for others). This type guard is used to determine if a given input can be treated as an untyped schema object within the context of the Powerlines schema system.
|
|
256
|
-
*
|
|
257
|
-
* @param input - The value to check.
|
|
258
|
-
* @returns True if the input is an untyped schema object, false otherwise.
|
|
259
|
-
*/
|
|
260
|
-
declare function isUntypedSchema(input: unknown): input is Schema;
|
|
261
|
-
/**
|
|
262
|
-
* Strict type guard for untyped schema objects.
|
|
263
|
-
*
|
|
264
|
-
* @remarks
|
|
265
|
-
* This guard narrows values to the Untyped schema model while explicitly
|
|
266
|
-
* rejecting values that are also valid JSON Schema instances.
|
|
267
|
-
*
|
|
268
|
-
* @param input - The value to check.
|
|
269
|
-
* @returns True if the input is an untyped schema and not a JSON Schema.
|
|
270
|
-
*/
|
|
271
|
-
declare function isUntypedSchemaStrict(input: unknown): input is Schema;
|
|
272
|
-
/**
|
|
273
|
-
* Type guard for untyped input objects.
|
|
274
|
-
*
|
|
275
|
-
* @remarks
|
|
276
|
-
* This function checks if the input is an untyped input object, which is defined as having certain properties that are commonly found in untyped input definitions. This includes properties such as `$schema` and `$resolve`. The function verifies that these properties, if present, conform to the expected types (e.g., objects for `$schema`, functions for `$resolve`). This type guard is used to determine if a given input can be treated as an untyped input object within the context of the Powerlines schema system.
|
|
277
|
-
*
|
|
278
|
-
* @param input - The value to check.
|
|
279
|
-
* @returns True if the input is an untyped input object, false otherwise.
|
|
280
|
-
*/
|
|
281
|
-
declare function isUntypedInput(input: unknown): input is InputObject;
|
|
282
|
-
/**
|
|
283
|
-
* Strict type guard for untyped input objects.
|
|
284
|
-
*
|
|
285
|
-
* @remarks
|
|
286
|
-
* This guard narrows values to the Untyped input-object model while
|
|
287
|
-
* explicitly rejecting values that are valid JSON Schema objects.
|
|
288
|
-
*
|
|
289
|
-
* @param input - The value to check.
|
|
290
|
-
* @returns True if the input is an untyped input object and not JSON Schema.
|
|
291
|
-
*/
|
|
292
|
-
declare function isUntypedInputStrict(input: unknown): input is InputObject;
|
|
293
|
-
/**
|
|
294
|
-
* Type guard for Powerlines Schema objects.
|
|
295
|
-
*
|
|
296
|
-
* @param input - The value to check.
|
|
297
|
-
* @returns True if the input is a Powerlines Schema object, false otherwise.
|
|
298
|
-
*/
|
|
299
|
-
declare function isSchema(input: unknown): input is Schema$1;
|
|
300
|
-
/**
|
|
301
|
-
* Type guard for extracted schema objects that include source information.
|
|
302
|
-
*
|
|
303
|
-
* @param input - The value to check.
|
|
304
|
-
* @returns True if the input is a SchemaWithSource object, false otherwise.
|
|
305
|
-
*/
|
|
306
|
-
declare function isSchemaWithSource(input: unknown): input is ExtractedSchema;
|
|
307
|
-
/**
|
|
308
|
-
* Type guard for Powerlines Schemas that are in Object form.
|
|
309
|
-
*
|
|
310
|
-
* @param input - The value to check.
|
|
311
|
-
* @returns True if the input is a Powerlines Schema object in Object form, false otherwise.
|
|
312
|
-
*/
|
|
313
|
-
declare function isSchemaObject(input: unknown): input is Schema$1<JsonSchemaObject>;
|
|
314
|
-
//#endregion
|
|
315
|
-
export { isJsonSchema, isJsonSchemaAllOf, isJsonSchemaAny, isJsonSchemaAnyOf, isJsonSchemaArray, isJsonSchemaBigint, isJsonSchemaBoolean, isJsonSchemaDate, isJsonSchemaDecimal, isJsonSchemaEnum, isJsonSchemaInteger, isJsonSchemaKeywords, isJsonSchemaLiteral, isJsonSchemaMap, isJsonSchemaNativeEnum, isJsonSchemaNever, isJsonSchemaNull, isJsonSchemaNullable, isJsonSchemaNumber, isJsonSchemaObject, isJsonSchemaPrimitiveType, isJsonSchemaPrimitiveUnion, isJsonSchemaRecord, isJsonSchemaRef, isJsonSchemaSet, isJsonSchemaString, isJsonSchemaTuple, isJsonSchemaType, isJsonSchemaUndefined, isJsonSchemaUnion, isJsonSchemaUnknown, isNullOnlyJsonSchema, isSchema, isSchemaObject, isSchemaWithSource, isStandardSchema, isUntypedInput, isUntypedInputStrict, isUntypedSchema, isUntypedSchemaStrict, isValibotSchema };
|
|
316
|
-
//# sourceMappingURL=type-checks.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"type-checks.d.cts","names":[],"sources":["../src/type-checks.ts"],"mappings":";;;;;;;;AAoGA;;;;iBAAgB,yBAAA,CACd,KAAA,YACC,KAAA,IAAS,uBAAuB;;;;AAAA;AAanC;;iBAAgB,gBAAA,CAAiB,KAAA,YAAiB,KAAA,IAAS,cAAc;;;;;;AAAA;iBA8QzD,oBAAA,CACd,KAAA,YACC,KAAA,IAAS,kBAAkB;;;;;;;iBAcd,eAAA,CAAgB,KAAA,YAAiB,KAAA,IAAS,aAAa;AAdzC;AAc9B;;;;;AAd8B,iBA8Bd,iBAAA,CAAkB,KAAA,YAAiB,KAAA,IAAS,eAAe;;;AAhBJ;AAgBvE;;;iBA+BgB,kBAAA,CAAmB,KAAA,YAAiB,KAAA,IAAS,gBAAgB;;;;;AA/BF;AA+B3E;iBA+BgB,mBAAA,CACd,KAAA,YACC,KAAA,IAAS,iBAAiB;;;;;;;iBAoBb,gBAAA,CAAiB,KAAA,YAAiB,KAAA,IAAS,cAAc;AAtBzE;;;;;;AAAA,iBA2DgB,gBAAA,CAAiB,KAAA,YAAiB,KAAA,IAAS,cAAc;;AAzD5C;AAoB7B;;;;iBA4FgB,iBAAA,CAAkB,KAAA,YAAiB,KAAA,IAAS,eAAe;;;;AA5FF;AAqCzE;;iBAiFgB,mBAAA,CACd,KAAA,YACC,KAAA,IAAS,iBAAiB;;;;;;AAnF4C;iBA0GzD,eAAA,CAAgB,KAAA,YAAiB,KAAA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KAAA,IAAS,eAAe;;;;;;AApLE;iBAsM7D,eAAA,CAAgB,KAAA,YAAiB,KAAA,IAAS,aAAa;;;;;;;iBAgBvD,gBAAA,CAAiB,KAAA,YAAiB,KAAA,IAAS,gBAAgB;AA7LA;AA8B3E;;;;;AA9B2E,iBAkN3D,eAAA,CACd,KAAA,YACC,KAAA,IAAS,UAAU;;;AApLS;AAoB/B;;;;;;iBA0LgB,YAAA,CAAa,KAAA,YAAiB,KAAA,IAAS,UAAU;;AAxL7B;AAsEpC;;;;;;;iBAwJgB,oBAAA,CAAqB,KAAA,YAAiB,KAAA,IAAS,cAAc;AAxJF;AAmB3E;;;;;;;;AAnB2E,iBAqK3D,eAAA,CAAgB,KAAA,YAAiB,KAAA,IAAS,MAAa;AAtIvE;;;;;;;;AAA2E;AAkB3E;AAlBA,iBA+LgB,qBAAA,CAAsB,KAAA,YAAiB,KAAA,IAAS,MAAa;;;;;;;AA7KN;AAgBvE;;iBA0KgB,cAAA,CAAe,KAAA,YAAiB,KAAA,IAAS,WAAkB;;;;;;AA1KA;AAqB3E;;;;iBA+KgB,oBAAA,CACd,KAAA,YACC,KAAA,IAAS,WAAkB;;;;AA/KR;AA0BtB;;iBA4KgB,QAAA,CAAS,KAAA,YAAiB,KAAA,IAAS,QAAM;;;;;;AA5KQ;iBA8LjD,kBAAA,CAAmB,KAAA,YAAiB,KAAA,IAAS,eAAgB;;;;;;;iBAiB7D,cAAA,CACd,KAAA,YACC,KAAA,IAAS,QAAM,CAAC,gBAAA"}
|
package/dist/type-checks.d.mts
DELETED
|
@@ -1,318 +0,0 @@
|
|
|
1
|
-
import __tsdown_shims_path from 'node:path';
|
|
2
|
-
import __tsdown_shims_url from 'node:url';
|
|
3
|
-
import { ExtractedSchema, JsonSchema, JsonSchemaAllOf, JsonSchemaAny, JsonSchemaAnyOf, JsonSchemaArray, JsonSchemaBigint, JsonSchemaBoolean, JsonSchemaDate, JsonSchemaDecimal, JsonSchemaEnum, JsonSchemaInteger, JsonSchemaKeywords, JsonSchemaLiteral, JsonSchemaMap, JsonSchemaNativeEnum, JsonSchemaNever, JsonSchemaNull, JsonSchemaNullable, JsonSchemaNumber, JsonSchemaObject, JsonSchemaPrimitiveType, JsonSchemaPrimitiveUnion, JsonSchemaRecord, JsonSchemaRef, JsonSchemaSet, JsonSchemaString, JsonSchemaTuple, JsonSchemaType, JsonSchemaUndefined, JsonSchemaUnion, JsonSchemaUnknown, Schema as Schema$1 } from "./types.mjs";
|
|
4
|
-
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
5
|
-
import { InputObject, Schema } from "untyped";
|
|
6
|
-
import { BaseSchema } from "valibot";
|
|
7
|
-
|
|
8
|
-
//#region src/type-checks.d.ts
|
|
9
|
-
/**
|
|
10
|
-
* A helper type guard to check if a value is a JSON Schema primitive type.
|
|
11
|
-
*
|
|
12
|
-
* @param value - The value to check.
|
|
13
|
-
* @returns True if the value is a JSON Schema primitive type, false otherwise.
|
|
14
|
-
*/
|
|
15
|
-
declare function isJsonSchemaPrimitiveType(value: unknown): value is JsonSchemaPrimitiveType;
|
|
16
|
-
/**
|
|
17
|
-
* A helper type guard to check if a value is a JSON Schema type.
|
|
18
|
-
*
|
|
19
|
-
* @param value - The value to check.
|
|
20
|
-
* @returns True if the value is a JSON Schema type, false otherwise.
|
|
21
|
-
*/
|
|
22
|
-
declare function isJsonSchemaType(value: unknown): value is JsonSchemaType;
|
|
23
|
-
/**
|
|
24
|
-
* Type guard for shared JSON Schema keyword groups.
|
|
25
|
-
*
|
|
26
|
-
* @param input - The value to check.
|
|
27
|
-
* @returns True if the input is a JSON Schema keyword group, false otherwise.
|
|
28
|
-
*/
|
|
29
|
-
declare function isJsonSchemaKeywords(input: unknown): input is JsonSchemaKeywords;
|
|
30
|
-
/**
|
|
31
|
-
* Type guard for generic JSON Schema objects with optional `$ref`.
|
|
32
|
-
*
|
|
33
|
-
* @param input - The value to check.
|
|
34
|
-
* @returns True if the input is a generic JSON Schema object, false otherwise.
|
|
35
|
-
*/
|
|
36
|
-
declare function isJsonSchemaAny(input: unknown): input is JsonSchemaAny;
|
|
37
|
-
/**
|
|
38
|
-
* Type guard for JSON Schema array types.
|
|
39
|
-
*
|
|
40
|
-
* @param input - The value to check.
|
|
41
|
-
* @returns True if the input is a JSON Schema array schema, false otherwise.
|
|
42
|
-
*/
|
|
43
|
-
declare function isJsonSchemaArray(input: unknown): input is JsonSchemaArray;
|
|
44
|
-
/**
|
|
45
|
-
* Type guard for bigint-backed integer schemas.
|
|
46
|
-
*
|
|
47
|
-
* @param input - The value to check.
|
|
48
|
-
* @returns True if the input is a bigint-backed integer schema, false otherwise.
|
|
49
|
-
*/
|
|
50
|
-
declare function isJsonSchemaBigint(input: unknown): input is JsonSchemaBigint;
|
|
51
|
-
/**
|
|
52
|
-
* Type guard for boolean schemas.
|
|
53
|
-
*
|
|
54
|
-
* @param input - The value to check.
|
|
55
|
-
* @returns True if the input is a boolean schema, false otherwise.
|
|
56
|
-
*/
|
|
57
|
-
declare function isJsonSchemaBoolean(input: unknown): input is JsonSchemaBoolean;
|
|
58
|
-
/**
|
|
59
|
-
* Type guard for date/time schemas.
|
|
60
|
-
*
|
|
61
|
-
* @param input - The value to check.
|
|
62
|
-
* @returns True if the input is a date or time schema, false otherwise.
|
|
63
|
-
*/
|
|
64
|
-
declare function isJsonSchemaDate(input: unknown): input is JsonSchemaDate;
|
|
65
|
-
/**
|
|
66
|
-
* Type guard for enum-constrained schemas.
|
|
67
|
-
*
|
|
68
|
-
* @param input - The value to check.
|
|
69
|
-
* @returns True if the input is an enum-constrained schema, false otherwise.
|
|
70
|
-
*/
|
|
71
|
-
declare function isJsonSchemaEnum(input: unknown): input is JsonSchemaEnum;
|
|
72
|
-
/**
|
|
73
|
-
* Type guard for `allOf` composition schemas.
|
|
74
|
-
*
|
|
75
|
-
* @param input - The value to check.
|
|
76
|
-
* @returns True if the input is an `allOf` schema, false otherwise.
|
|
77
|
-
*/
|
|
78
|
-
declare function isJsonSchemaAllOf(input: unknown): input is JsonSchemaAllOf;
|
|
79
|
-
/**
|
|
80
|
-
* Type guard for literal-value schemas.
|
|
81
|
-
*
|
|
82
|
-
* @param input - The value to check.
|
|
83
|
-
* @returns True if the input is a literal-value schema, false otherwise.
|
|
84
|
-
*/
|
|
85
|
-
declare function isJsonSchemaLiteral(input: unknown): input is JsonSchemaLiteral;
|
|
86
|
-
/**
|
|
87
|
-
* Type guard for map tuple-array schemas.
|
|
88
|
-
*
|
|
89
|
-
* @param input - The value to check.
|
|
90
|
-
* @returns True if the input is a map tuple-array schema, false otherwise.
|
|
91
|
-
*/
|
|
92
|
-
declare function isJsonSchemaMap(input: unknown): input is JsonSchemaMap;
|
|
93
|
-
/**
|
|
94
|
-
* Type guard for native enum schemas.
|
|
95
|
-
*
|
|
96
|
-
* @param input - The value to check.
|
|
97
|
-
* @returns True if the input is a native enum schema, false otherwise.
|
|
98
|
-
*/
|
|
99
|
-
declare function isJsonSchemaNativeEnum(input: unknown): input is JsonSchemaNativeEnum;
|
|
100
|
-
/**
|
|
101
|
-
* Type guard for impossible/never schemas.
|
|
102
|
-
*
|
|
103
|
-
* @param input - The value to check.
|
|
104
|
-
* @returns True if the input is a never schema, false otherwise.
|
|
105
|
-
*/
|
|
106
|
-
declare function isJsonSchemaNever(input: unknown): input is JsonSchemaNever;
|
|
107
|
-
/**
|
|
108
|
-
* Type guard for `null` schemas.
|
|
109
|
-
*
|
|
110
|
-
* @param input - The value to check.
|
|
111
|
-
* @returns True if the input is a null schema, false otherwise.
|
|
112
|
-
*/
|
|
113
|
-
declare function isJsonSchemaNull(input: unknown): input is JsonSchemaNull;
|
|
114
|
-
/**
|
|
115
|
-
* Type guard for nullable schema unions.
|
|
116
|
-
*
|
|
117
|
-
* @param input - The value to check.
|
|
118
|
-
* @returns True if the input is a nullable schema union, false otherwise.
|
|
119
|
-
*/
|
|
120
|
-
declare function isJsonSchemaNullable(input: unknown): input is JsonSchemaNullable;
|
|
121
|
-
/**
|
|
122
|
-
* Type guard for numeric schemas.
|
|
123
|
-
*
|
|
124
|
-
* @param input - The value to check.
|
|
125
|
-
* @returns True if the input is a numeric schema, false otherwise.
|
|
126
|
-
*/
|
|
127
|
-
declare function isJsonSchemaNumber(input: unknown): input is JsonSchemaNumber;
|
|
128
|
-
/**
|
|
129
|
-
* Type guard for integer schemas.
|
|
130
|
-
*
|
|
131
|
-
* @param input - The value to check.
|
|
132
|
-
* @returns True if the input is an integer schema, false otherwise.
|
|
133
|
-
*/
|
|
134
|
-
declare function isJsonSchemaInteger(input: unknown): input is JsonSchemaInteger;
|
|
135
|
-
/**
|
|
136
|
-
* Type guard for decimal schemas.
|
|
137
|
-
*
|
|
138
|
-
* @param input - The value to check.
|
|
139
|
-
* @returns True if the input is a decimal schema, false otherwise.
|
|
140
|
-
*/
|
|
141
|
-
declare function isJsonSchemaDecimal(input: unknown): input is JsonSchemaDecimal;
|
|
142
|
-
/**
|
|
143
|
-
* Type guard for object schemas.
|
|
144
|
-
*
|
|
145
|
-
* @param input - The value to check.
|
|
146
|
-
* @returns True if the input is an object schema, false otherwise.
|
|
147
|
-
*/
|
|
148
|
-
declare function isJsonSchemaObject(input: unknown): input is JsonSchemaObject;
|
|
149
|
-
/**
|
|
150
|
-
* Type guard for string schemas.
|
|
151
|
-
*
|
|
152
|
-
* @param input - The value to check.
|
|
153
|
-
* @returns True if the input is a string schema, false otherwise.
|
|
154
|
-
*/
|
|
155
|
-
declare function isJsonSchemaString(input: unknown): input is JsonSchemaString;
|
|
156
|
-
/**
|
|
157
|
-
* Type guard for set-like array schemas.
|
|
158
|
-
*
|
|
159
|
-
* @param input - The value to check.
|
|
160
|
-
* @returns True if the input is a set-like array schema, false otherwise.
|
|
161
|
-
*/
|
|
162
|
-
declare function isJsonSchemaSet(input: unknown): input is JsonSchemaSet;
|
|
163
|
-
/**
|
|
164
|
-
* Type guard for record schemas.
|
|
165
|
-
*
|
|
166
|
-
* @param input - The value to check.
|
|
167
|
-
* @returns True if the input is a record schema, false otherwise.
|
|
168
|
-
*/
|
|
169
|
-
declare function isJsonSchemaRecord(input: unknown): input is JsonSchemaRecord;
|
|
170
|
-
/**
|
|
171
|
-
* Type guard for tuple schemas.
|
|
172
|
-
*
|
|
173
|
-
* @param input - The value to check.
|
|
174
|
-
* @returns True if the input is a tuple schema, false otherwise.
|
|
175
|
-
*/
|
|
176
|
-
declare function isJsonSchemaTuple(input: unknown): input is JsonSchemaTuple;
|
|
177
|
-
/**
|
|
178
|
-
* Type guard for undefined-representing schemas.
|
|
179
|
-
*
|
|
180
|
-
* @param input - The value to check.
|
|
181
|
-
* @returns True if the input is an undefined-representing schema, false otherwise.
|
|
182
|
-
*/
|
|
183
|
-
declare function isJsonSchemaUndefined(input: unknown): input is JsonSchemaUndefined;
|
|
184
|
-
/**
|
|
185
|
-
* Type guard for primitive-union schema variants.
|
|
186
|
-
*
|
|
187
|
-
* @param input - The value to check.
|
|
188
|
-
* @returns True if the input is a primitive-union schema variant, false otherwise.
|
|
189
|
-
*/
|
|
190
|
-
declare function isJsonSchemaPrimitiveUnion(input: unknown): input is JsonSchemaPrimitiveUnion;
|
|
191
|
-
/**
|
|
192
|
-
* Type guard for union schemas.
|
|
193
|
-
*
|
|
194
|
-
* @param input - The value to check.
|
|
195
|
-
* @returns True if the input is a union schema, false otherwise.
|
|
196
|
-
*/
|
|
197
|
-
declare function isJsonSchemaUnion(input: unknown): input is JsonSchemaUnion;
|
|
198
|
-
/**
|
|
199
|
-
* Type guard for permissive unknown schemas.
|
|
200
|
-
*
|
|
201
|
-
* @param input - The value to check.
|
|
202
|
-
* @returns True if the input is a permissive unknown schema, false otherwise.
|
|
203
|
-
*/
|
|
204
|
-
declare function isJsonSchemaUnknown(input: unknown): input is JsonSchemaUnknown;
|
|
205
|
-
/**
|
|
206
|
-
* Type guard for `anyOf` composition schemas.
|
|
207
|
-
*
|
|
208
|
-
* @param input - The value to check.
|
|
209
|
-
* @returns True if the input is an `anyOf` schema, false otherwise.
|
|
210
|
-
*/
|
|
211
|
-
declare function isJsonSchemaAnyOf(input: unknown): input is JsonSchemaAnyOf;
|
|
212
|
-
/**
|
|
213
|
-
* Type guard for reference schemas.
|
|
214
|
-
*
|
|
215
|
-
* @param input - The value to check.
|
|
216
|
-
* @returns True if the input is a reference schema, false otherwise.
|
|
217
|
-
*/
|
|
218
|
-
declare function isJsonSchemaRef(input: unknown): input is JsonSchemaRef;
|
|
219
|
-
/**
|
|
220
|
-
* Type guard for Standard Schema V1 objects.
|
|
221
|
-
*
|
|
222
|
-
* @param input - The value to check.
|
|
223
|
-
* @returns True if the input is a Standard Schema V1 object, false otherwise.
|
|
224
|
-
*/
|
|
225
|
-
declare function isStandardSchema(input: unknown): input is StandardSchemaV1;
|
|
226
|
-
/**
|
|
227
|
-
* Type guard for Valibot BaseSchema objects.
|
|
228
|
-
*
|
|
229
|
-
* @param input - The value to check.
|
|
230
|
-
* @returns True if the input is a Valibot BaseSchema, false otherwise.
|
|
231
|
-
*/
|
|
232
|
-
declare function isValibotSchema(input: unknown): input is BaseSchema<any, any, any>;
|
|
233
|
-
/**
|
|
234
|
-
* Type guard for JSON Schema types.
|
|
235
|
-
*
|
|
236
|
-
* @remarks
|
|
237
|
-
* This function checks if the input is a JSON Schema type, which is defined as having a `type` property or a `$ref` property. This is used to determine if a given input conforms to the structure of a JSON Schema definition that includes type information.
|
|
238
|
-
*
|
|
239
|
-
* @param input - The value to check.
|
|
240
|
-
* @returns True if the input is a JSON Schema type, false otherwise.
|
|
241
|
-
*/
|
|
242
|
-
declare function isJsonSchema(input: unknown): input is JsonSchema;
|
|
243
|
-
/**
|
|
244
|
-
* Type guard for JSON Schemas that only accept `null`.
|
|
245
|
-
*
|
|
246
|
-
* @remarks
|
|
247
|
-
* This function checks if the input is a JSON Schema that exclusively accepts the `null` type. It verifies that the input is a valid JSON Schema and that its `type` property is set to "null". This is useful for identifying schemas that are specifically designed to allow only `null` values.
|
|
248
|
-
*
|
|
249
|
-
* @param input - The value to check.
|
|
250
|
-
* @returns True if the input is a JSON Schema that only accepts `null`, false otherwise.
|
|
251
|
-
*/
|
|
252
|
-
declare function isNullOnlyJsonSchema(input: unknown): input is JsonSchemaNull;
|
|
253
|
-
/**
|
|
254
|
-
* Type guard for untyped schema objects.
|
|
255
|
-
*
|
|
256
|
-
* @remarks
|
|
257
|
-
* This function checks if the input is an untyped schema object, which is defined as having certain properties that are commonly found in untyped schema definitions. This includes properties such as `id`, `title`, `description`, `$schema`, `tsType`, `markdownType`, `type`, `required`, `tags`, `args`, `properties`, and `resolve`. The function verifies that these properties, if present, conform to the expected types (e.g., strings for certain properties, arrays for others). This type guard is used to determine if a given input can be treated as an untyped schema object within the context of the Powerlines schema system.
|
|
258
|
-
*
|
|
259
|
-
* @param input - The value to check.
|
|
260
|
-
* @returns True if the input is an untyped schema object, false otherwise.
|
|
261
|
-
*/
|
|
262
|
-
declare function isUntypedSchema(input: unknown): input is Schema;
|
|
263
|
-
/**
|
|
264
|
-
* Strict type guard for untyped schema objects.
|
|
265
|
-
*
|
|
266
|
-
* @remarks
|
|
267
|
-
* This guard narrows values to the Untyped schema model while explicitly
|
|
268
|
-
* rejecting values that are also valid JSON Schema instances.
|
|
269
|
-
*
|
|
270
|
-
* @param input - The value to check.
|
|
271
|
-
* @returns True if the input is an untyped schema and not a JSON Schema.
|
|
272
|
-
*/
|
|
273
|
-
declare function isUntypedSchemaStrict(input: unknown): input is Schema;
|
|
274
|
-
/**
|
|
275
|
-
* Type guard for untyped input objects.
|
|
276
|
-
*
|
|
277
|
-
* @remarks
|
|
278
|
-
* This function checks if the input is an untyped input object, which is defined as having certain properties that are commonly found in untyped input definitions. This includes properties such as `$schema` and `$resolve`. The function verifies that these properties, if present, conform to the expected types (e.g., objects for `$schema`, functions for `$resolve`). This type guard is used to determine if a given input can be treated as an untyped input object within the context of the Powerlines schema system.
|
|
279
|
-
*
|
|
280
|
-
* @param input - The value to check.
|
|
281
|
-
* @returns True if the input is an untyped input object, false otherwise.
|
|
282
|
-
*/
|
|
283
|
-
declare function isUntypedInput(input: unknown): input is InputObject;
|
|
284
|
-
/**
|
|
285
|
-
* Strict type guard for untyped input objects.
|
|
286
|
-
*
|
|
287
|
-
* @remarks
|
|
288
|
-
* This guard narrows values to the Untyped input-object model while
|
|
289
|
-
* explicitly rejecting values that are valid JSON Schema objects.
|
|
290
|
-
*
|
|
291
|
-
* @param input - The value to check.
|
|
292
|
-
* @returns True if the input is an untyped input object and not JSON Schema.
|
|
293
|
-
*/
|
|
294
|
-
declare function isUntypedInputStrict(input: unknown): input is InputObject;
|
|
295
|
-
/**
|
|
296
|
-
* Type guard for Powerlines Schema objects.
|
|
297
|
-
*
|
|
298
|
-
* @param input - The value to check.
|
|
299
|
-
* @returns True if the input is a Powerlines Schema object, false otherwise.
|
|
300
|
-
*/
|
|
301
|
-
declare function isSchema(input: unknown): input is Schema$1;
|
|
302
|
-
/**
|
|
303
|
-
* Type guard for extracted schema objects that include source information.
|
|
304
|
-
*
|
|
305
|
-
* @param input - The value to check.
|
|
306
|
-
* @returns True if the input is a SchemaWithSource object, false otherwise.
|
|
307
|
-
*/
|
|
308
|
-
declare function isSchemaWithSource(input: unknown): input is ExtractedSchema;
|
|
309
|
-
/**
|
|
310
|
-
* Type guard for Powerlines Schemas that are in Object form.
|
|
311
|
-
*
|
|
312
|
-
* @param input - The value to check.
|
|
313
|
-
* @returns True if the input is a Powerlines Schema object in Object form, false otherwise.
|
|
314
|
-
*/
|
|
315
|
-
declare function isSchemaObject(input: unknown): input is Schema$1<JsonSchemaObject>;
|
|
316
|
-
//#endregion
|
|
317
|
-
export { isJsonSchema, isJsonSchemaAllOf, isJsonSchemaAny, isJsonSchemaAnyOf, isJsonSchemaArray, isJsonSchemaBigint, isJsonSchemaBoolean, isJsonSchemaDate, isJsonSchemaDecimal, isJsonSchemaEnum, isJsonSchemaInteger, isJsonSchemaKeywords, isJsonSchemaLiteral, isJsonSchemaMap, isJsonSchemaNativeEnum, isJsonSchemaNever, isJsonSchemaNull, isJsonSchemaNullable, isJsonSchemaNumber, isJsonSchemaObject, isJsonSchemaPrimitiveType, isJsonSchemaPrimitiveUnion, isJsonSchemaRecord, isJsonSchemaRef, isJsonSchemaSet, isJsonSchemaString, isJsonSchemaTuple, isJsonSchemaType, isJsonSchemaUndefined, isJsonSchemaUnion, isJsonSchemaUnknown, isNullOnlyJsonSchema, isSchema, isSchemaObject, isSchemaWithSource, isStandardSchema, isUntypedInput, isUntypedInputStrict, isUntypedSchema, isUntypedSchemaStrict, isValibotSchema };
|
|
318
|
-
//# sourceMappingURL=type-checks.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"type-checks.d.mts","names":[],"sources":["../src/type-checks.ts"],"mappings":";;;;;;;;;;;;;;iBAoGgB,yBAAA,CACd,KAAA,YACC,KAAA,IAAS,uBAAuB;;;;AAFnC;;;iBAegB,gBAAA,CAAiB,KAAA,YAAiB,KAAA,IAAS,cAAc;;;;;AAbtC;AAanC;iBA8QgB,oBAAA,CACd,KAAA,YACC,KAAA,IAAS,kBAAkB;;;;;;;iBAcd,eAAA,CAAgB,KAAA,YAAiB,KAAA,IAAS,aAAa;AAhBvE;;;;;;AAAA,iBAgCgB,iBAAA,CAAkB,KAAA,YAAiB,KAAA,IAAS,eAAe;;AA9B7C;AAc9B;;;;iBA+CgB,kBAAA,CAAmB,KAAA,YAAiB,KAAA,IAAS,gBAAgB;;;;AA/CN;AAgBvE;;iBA8DgB,mBAAA,CACd,KAAA,YACC,KAAA,IAAS,iBAAiB;;;;;;AAhE8C;iBAoF3D,gBAAA,CAAiB,KAAA,YAAiB,KAAA,IAAS,cAAc;;;;;;;iBAqCzD,gBAAA,CAAiB,KAAA,YAAiB,KAAA,IAAS,cAAc;AA1FI;AA+B7E;;;;;AA/B6E,iBAiJ7D,iBAAA,CAAkB,KAAA,YAAiB,KAAA,IAAS,eAAe;;;AAhH9C;AAoB7B;;;iBAsHgB,mBAAA,CACd,KAAA,YACC,KAAA,IAAS,iBAAiB;;;;;AAxH4C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