typebox 1.0.35 → 1.0.37
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/build/schema/build.d.mts +6 -6
- package/build/schema/check.d.mts +3 -3
- package/build/schema/deref/deref.d.mts +1 -1
- package/build/schema/deref/deref.mjs +2 -2
- package/build/schema/engine/_context.d.mts +7 -7
- package/build/schema/engine/_functions.d.mts +1 -1
- package/build/schema/engine/_reducer.d.mts +1 -1
- package/build/schema/engine/ref.mjs +3 -3
- package/build/schema/engine/schema.d.mts +3 -3
- package/build/schema/engine/schema.mjs +4 -4
- package/build/schema/errors.d.mts +3 -3
- package/build/schema/schema.d.mts +1 -0
- package/build/schema/schema.mjs +1 -0
- package/build/schema/static/additionalProperties.d.mts +7 -0
- package/build/schema/static/allOf.d.mts +3 -0
- package/build/schema/static/allOf.mjs +2 -0
- package/build/schema/static/anyOf.d.mts +3 -0
- package/build/schema/static/anyOf.mjs +2 -0
- package/build/schema/static/const.d.mts +1 -0
- package/build/schema/static/const.mjs +2 -0
- package/build/schema/static/enum.d.mts +1 -0
- package/build/schema/static/enum.mjs +2 -0
- package/build/schema/static/index.d.mts +1 -0
- package/build/schema/static/index.mjs +1 -0
- package/build/schema/static/items.d.mts +6 -0
- package/build/schema/static/items.mjs +2 -0
- package/build/schema/static/oneOf.d.mts +3 -0
- package/build/schema/static/oneOf.mjs +2 -0
- package/build/schema/static/patternProperties.d.mts +7 -0
- package/build/schema/static/patternProperties.mjs +2 -0
- package/build/schema/static/prefixItems.d.mts +3 -0
- package/build/schema/static/prefixItems.mjs +2 -0
- package/build/schema/static/properties.d.mts +11 -0
- package/build/schema/static/properties.mjs +2 -0
- package/build/schema/static/required.d.mts +13 -0
- package/build/schema/static/required.mjs +2 -0
- package/build/schema/static/schema.d.mts +48 -0
- package/build/schema/static/schema.mjs +2 -0
- package/build/schema/static/static.d.mts +5 -0
- package/build/schema/static/static.mjs +2 -0
- package/build/schema/static/type.d.mts +4 -0
- package/build/schema/static/type.mjs +2 -0
- package/build/schema/static/unevaluatedProperties.d.mts +7 -0
- package/build/schema/static/unevaluatedProperties.mjs +2 -0
- package/build/schema/static/~mutable.d.mts +7 -0
- package/build/schema/static/~mutable.mjs +2 -0
- package/build/schema/static/~readonly.d.mts +6 -0
- package/build/schema/static/~readonly.mjs +2 -0
- package/build/schema/types/_guard.d.mts +2 -2
- package/build/schema/types/_refine.d.mts +2 -2
- package/build/schema/types/additionalItems.d.mts +3 -3
- package/build/schema/types/additionalItems.mjs +2 -2
- package/build/schema/types/additionalProperties.d.mts +3 -3
- package/build/schema/types/additionalProperties.mjs +2 -2
- package/build/schema/types/allOf.d.mts +3 -3
- package/build/schema/types/allOf.mjs +2 -2
- package/build/schema/types/anyOf.d.mts +3 -3
- package/build/schema/types/anyOf.mjs +2 -2
- package/build/schema/types/const.d.mts +2 -2
- package/build/schema/types/contains.d.mts +3 -3
- package/build/schema/types/contains.mjs +2 -2
- package/build/schema/types/contentEncoding.d.mts +2 -2
- package/build/schema/types/contentMediaType.d.mts +2 -2
- package/build/schema/types/default.d.mts +2 -2
- package/build/schema/types/defs.d.mts +3 -3
- package/build/schema/types/defs.mjs +2 -2
- package/build/schema/types/dependencies.d.mts +2 -2
- package/build/schema/types/dependencies.mjs +2 -2
- package/build/schema/types/dependentRequired.d.mts +2 -2
- package/build/schema/types/dependentSchemas.d.mts +3 -3
- package/build/schema/types/dependentSchemas.mjs +2 -2
- package/build/schema/types/else.d.mts +3 -3
- package/build/schema/types/else.mjs +2 -2
- package/build/schema/types/enum.d.mts +2 -2
- package/build/schema/types/exclusiveMaximum.d.mts +2 -2
- package/build/schema/types/exclusiveMinimum.d.mts +2 -2
- package/build/schema/types/format.d.mts +2 -2
- package/build/schema/types/id.d.mts +2 -2
- package/build/schema/types/if.d.mts +3 -3
- package/build/schema/types/if.mjs +2 -2
- package/build/schema/types/index.d.mts +0 -1
- package/build/schema/types/index.mjs +0 -1
- package/build/schema/types/items.d.mts +7 -7
- package/build/schema/types/items.mjs +3 -3
- package/build/schema/types/maxContains.d.mts +2 -2
- package/build/schema/types/maxItems.d.mts +2 -2
- package/build/schema/types/maxLength.d.mts +2 -2
- package/build/schema/types/maxProperties.d.mts +2 -2
- package/build/schema/types/maximum.d.mts +2 -2
- package/build/schema/types/minContains.d.mts +2 -2
- package/build/schema/types/minItems.d.mts +2 -2
- package/build/schema/types/minLength.d.mts +2 -2
- package/build/schema/types/minProperties.d.mts +2 -2
- package/build/schema/types/minimum.d.mts +2 -2
- package/build/schema/types/multipleOf.d.mts +2 -2
- package/build/schema/types/not.d.mts +3 -3
- package/build/schema/types/not.mjs +2 -2
- package/build/schema/types/oneOf.d.mts +3 -3
- package/build/schema/types/oneOf.mjs +2 -2
- package/build/schema/types/pattern.d.mts +2 -2
- package/build/schema/types/patternProperties.d.mts +3 -3
- package/build/schema/types/patternProperties.mjs +2 -2
- package/build/schema/types/prefixItems.d.mts +3 -3
- package/build/schema/types/prefixItems.mjs +2 -2
- package/build/schema/types/properties.d.mts +3 -3
- package/build/schema/types/properties.mjs +2 -2
- package/build/schema/types/propertyNames.d.mts +3 -3
- package/build/schema/types/propertyNames.mjs +2 -2
- package/build/schema/types/ref.d.mts +2 -2
- package/build/schema/types/required.d.mts +2 -2
- package/build/schema/types/schema.d.mts +4 -4
- package/build/schema/types/schema.mjs +3 -3
- package/build/schema/types/then.d.mts +3 -3
- package/build/schema/types/then.mjs +2 -2
- package/build/schema/types/type.d.mts +2 -2
- package/build/schema/types/unevaluatedItems.d.mts +4 -4
- package/build/schema/types/unevaluatedItems.mjs +2 -2
- package/build/schema/types/unevaluatedProperties.d.mts +3 -3
- package/build/schema/types/unevaluatedProperties.mjs +2 -2
- package/build/schema/types/uniqueItems.d.mts +2 -2
- package/build/type/engine/instantiate.d.mts +2 -1
- package/build/type/engine/instantiate.mjs +5 -1
- package/build/type/extends/array.d.mts +15 -2
- package/build/type/extends/array.mjs +16 -4
- package/build/type/extends/extends-left.d.mts +1 -1
- package/build/type/extends/extends-left.mjs +1 -1
- package/build/type/extends/literal.d.mts +2 -1
- package/build/type/extends/literal.mjs +4 -1
- package/build/type/script/mapping.d.mts +2 -0
- package/build/type/script/mapping.mjs +3 -0
- package/build/type/script/parser.d.mts +3 -1
- package/build/type/script/parser.mjs +2 -1
- package/build/type/types/_immutable.d.mts +16 -0
- package/build/type/types/_immutable.mjs +26 -0
- package/build/type/types/_readonly.d.mts +2 -2
- package/build/type/types/_readonly.mjs +3 -3
- package/build/type/types/_refine.mjs +1 -1
- package/build/type/types/array.d.mts +2 -1
- package/build/type/types/base.d.mts +1 -7
- package/build/type/types/base.mjs +12 -20
- package/build/type/types/index.d.mts +1 -0
- package/build/type/types/index.mjs +1 -0
- package/build/type/types/literal.d.mts +9 -0
- package/build/type/types/literal.mjs +22 -1
- package/build/type/types/static.d.mts +3 -2
- package/build/type/types/tuple.d.mts +2 -1
- package/build/typebox.d.mts +1 -0
- package/build/typebox.mjs +1 -0
- package/package.json +28 -28
- package/readme.md +1 -1
- package/build/schema/types/static.d.mts +0 -113
- /package/build/schema/{types/static.mjs → static/additionalProperties.mjs} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
2
|
import { Guard } from '../../guard/index.mjs';
|
|
3
|
-
import {
|
|
3
|
+
import { IsSchema } from './schema.mjs';
|
|
4
4
|
// ------------------------------------------------------------------
|
|
5
5
|
// Guard
|
|
6
6
|
// ------------------------------------------------------------------
|
|
@@ -11,5 +11,5 @@ import { IsSchemaLike } from './schema.mjs';
|
|
|
11
11
|
export function IsAnyOf(schema) {
|
|
12
12
|
return Guard.HasPropertyKey(schema, 'anyOf')
|
|
13
13
|
&& Guard.IsArray(schema.anyOf)
|
|
14
|
-
&& schema.anyOf.every(value =>
|
|
14
|
+
&& schema.anyOf.every(value => IsSchema(value));
|
|
15
15
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type XSchemaObject } from './schema.mjs';
|
|
2
2
|
export interface XConst<Const extends unknown = unknown> {
|
|
3
3
|
const: Const;
|
|
4
4
|
}
|
|
@@ -6,4 +6,4 @@ export interface XConst<Const extends unknown = unknown> {
|
|
|
6
6
|
* Returns true if the schema contains a valid const property
|
|
7
7
|
* @specification Json Schema 7
|
|
8
8
|
*/
|
|
9
|
-
export declare function IsConst(value:
|
|
9
|
+
export declare function IsConst(value: XSchemaObject): value is XConst;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export interface XContains<Contains extends
|
|
1
|
+
import { type XSchemaObject, type XSchema } from './schema.mjs';
|
|
2
|
+
export interface XContains<Contains extends XSchema = XSchema> {
|
|
3
3
|
contains: Contains;
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
6
|
* Returns true if the schema contains a valid contains property
|
|
7
7
|
* @specification Json Schema 7
|
|
8
8
|
*/
|
|
9
|
-
export declare function IsContains(schema:
|
|
9
|
+
export declare function IsContains(schema: XSchemaObject): schema is XContains;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
2
|
import { Guard } from '../../guard/index.mjs';
|
|
3
|
-
import {
|
|
3
|
+
import { IsSchema } from './schema.mjs';
|
|
4
4
|
// ------------------------------------------------------------------
|
|
5
5
|
// Guard
|
|
6
6
|
// ------------------------------------------------------------------
|
|
@@ -10,5 +10,5 @@ import { IsSchemaLike } from './schema.mjs';
|
|
|
10
10
|
*/
|
|
11
11
|
export function IsContains(schema) {
|
|
12
12
|
return Guard.HasPropertyKey(schema, 'contains')
|
|
13
|
-
&&
|
|
13
|
+
&& IsSchema(schema.contains);
|
|
14
14
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type XSchemaObject } from './schema.mjs';
|
|
2
2
|
export interface XContentEncoding<ContentEncoding extends string = string> {
|
|
3
3
|
contentEncoding: ContentEncoding;
|
|
4
4
|
}
|
|
@@ -6,4 +6,4 @@ export interface XContentEncoding<ContentEncoding extends string = string> {
|
|
|
6
6
|
* Returns true if the schema contains a valid contentEncoding property
|
|
7
7
|
* @specification Json Schema 7
|
|
8
8
|
*/
|
|
9
|
-
export declare function IsContentEncoding(schema:
|
|
9
|
+
export declare function IsContentEncoding(schema: XSchemaObject): schema is XContentEncoding;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type XSchemaObject } from './schema.mjs';
|
|
2
2
|
export interface XContentMediaType<ContentMediaType extends string = string> {
|
|
3
3
|
contentMediaType: ContentMediaType;
|
|
4
4
|
}
|
|
@@ -6,4 +6,4 @@ export interface XContentMediaType<ContentMediaType extends string = string> {
|
|
|
6
6
|
* Returns true if the schema contains a valid contentMediaType property
|
|
7
7
|
* @specification Json Schema 7
|
|
8
8
|
*/
|
|
9
|
-
export declare function IsContentMediaType(schema:
|
|
9
|
+
export declare function IsContentMediaType(schema: XSchemaObject): schema is XContentMediaType;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type XSchemaObject } from './schema.mjs';
|
|
2
2
|
export interface XDefault<Default extends unknown = unknown> {
|
|
3
3
|
default: Default;
|
|
4
4
|
}
|
|
@@ -6,4 +6,4 @@ export interface XDefault<Default extends unknown = unknown> {
|
|
|
6
6
|
* Returns true if the schema contains a valid contentMediaType property
|
|
7
7
|
* @specification Json Schema 7
|
|
8
8
|
*/
|
|
9
|
-
export declare function IsDefault(schema:
|
|
9
|
+
export declare function IsDefault(schema: XSchemaObject): schema is XDefault;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export interface XDefs<Defs extends Record<PropertyKey,
|
|
1
|
+
import { type XSchemaObject, type XSchema } from './schema.mjs';
|
|
2
|
+
export interface XDefs<Defs extends Record<PropertyKey, XSchema> = Record<PropertyKey, XSchema>> {
|
|
3
3
|
$defs: Defs;
|
|
4
4
|
}
|
|
5
5
|
/** Returns true if the schema contains a valid $defs property */
|
|
6
|
-
export declare function IsDefs(schema:
|
|
6
|
+
export declare function IsDefs(schema: XSchemaObject): schema is XDefs;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
2
|
import { Guard } from '../../guard/index.mjs';
|
|
3
|
-
import {
|
|
3
|
+
import { IsSchema } from './schema.mjs';
|
|
4
4
|
// ------------------------------------------------------------------
|
|
5
5
|
// Guard
|
|
6
6
|
// ------------------------------------------------------------------
|
|
@@ -8,5 +8,5 @@ import { IsSchemaLike } from './schema.mjs';
|
|
|
8
8
|
export function IsDefs(schema) {
|
|
9
9
|
return Guard.HasPropertyKey(schema, '$defs')
|
|
10
10
|
&& Guard.IsObject(schema.$defs)
|
|
11
|
-
&& Object.values(schema.$defs).every(value =>
|
|
11
|
+
&& Object.values(schema.$defs).every(value => IsSchema(value));
|
|
12
12
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type XSchemaObject } from './schema.mjs';
|
|
2
2
|
type XDependenciesProperty = Record<PropertyKey, boolean | Record<PropertyKey, unknown> | string[]>;
|
|
3
3
|
export interface XDependencies<Dependencies extends XDependenciesProperty = XDependenciesProperty> {
|
|
4
4
|
dependencies: Dependencies;
|
|
@@ -7,5 +7,5 @@ export interface XDependencies<Dependencies extends XDependenciesProperty = XDep
|
|
|
7
7
|
* Returns true if the schema contains a valid dependencies property
|
|
8
8
|
* @specification Json Schema 7
|
|
9
9
|
*/
|
|
10
|
-
export declare function IsDependencies(schema:
|
|
10
|
+
export declare function IsDependencies(schema: XSchemaObject): schema is XDependencies;
|
|
11
11
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
2
|
import { Guard } from '../../guard/index.mjs';
|
|
3
|
-
import {
|
|
3
|
+
import { IsSchema } from './schema.mjs';
|
|
4
4
|
// ------------------------------------------------------------------
|
|
5
5
|
// Guard
|
|
6
6
|
// ------------------------------------------------------------------
|
|
@@ -11,6 +11,6 @@ import { IsSchemaLike } from './schema.mjs';
|
|
|
11
11
|
export function IsDependencies(schema) {
|
|
12
12
|
return Guard.HasPropertyKey(schema, 'dependencies')
|
|
13
13
|
&& Guard.IsObject(schema.dependencies)
|
|
14
|
-
&& Object.values(schema.dependencies).every(value =>
|
|
14
|
+
&& Object.values(schema.dependencies).every(value => IsSchema(value)
|
|
15
15
|
|| Guard.IsArray(value) && value.every(value => Guard.IsString(value)));
|
|
16
16
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type XSchemaObject } from './schema.mjs';
|
|
2
2
|
export interface XDependentRequired<DependentRequired extends Record<PropertyKey, string[]> = Record<PropertyKey, string[]>> {
|
|
3
3
|
dependentRequired: DependentRequired;
|
|
4
4
|
}
|
|
@@ -6,4 +6,4 @@ export interface XDependentRequired<DependentRequired extends Record<PropertyKey
|
|
|
6
6
|
* Returns true if the schema contains a valid dependentRequired property
|
|
7
7
|
* @specification Json Schema 2019-09
|
|
8
8
|
*/
|
|
9
|
-
export declare function IsDependentRequired(schema:
|
|
9
|
+
export declare function IsDependentRequired(schema: XSchemaObject): schema is XDependentRequired;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export interface XDependentSchemas<DependentSchemas extends Record<PropertyKey,
|
|
1
|
+
import { type XSchemaObject, type XSchema } from './schema.mjs';
|
|
2
|
+
export interface XDependentSchemas<DependentSchemas extends Record<PropertyKey, XSchema> = Record<PropertyKey, XSchema>> {
|
|
3
3
|
dependentSchemas: DependentSchemas;
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
6
|
* Returns true if the schema contains a valid dependentRequired property
|
|
7
7
|
* @specification Json Schema 2019-09
|
|
8
8
|
*/
|
|
9
|
-
export declare function IsDependentSchemas(schema:
|
|
9
|
+
export declare function IsDependentSchemas(schema: XSchemaObject): schema is XDependentSchemas;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
2
|
import { Guard } from '../../guard/index.mjs';
|
|
3
|
-
import {
|
|
3
|
+
import { IsSchema } from './schema.mjs';
|
|
4
4
|
// ------------------------------------------------------------------
|
|
5
5
|
// Guard
|
|
6
6
|
// ------------------------------------------------------------------
|
|
@@ -11,5 +11,5 @@ import { IsSchemaLike } from './schema.mjs';
|
|
|
11
11
|
export function IsDependentSchemas(schema) {
|
|
12
12
|
return Guard.HasPropertyKey(schema, 'dependentSchemas')
|
|
13
13
|
&& Guard.IsObject(schema.dependentSchemas)
|
|
14
|
-
&& Object.values(schema.dependentSchemas).every(value =>
|
|
14
|
+
&& Object.values(schema.dependentSchemas).every(value => IsSchema(value));
|
|
15
15
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export interface XElse<Else extends
|
|
1
|
+
import { type XSchemaObject, type XSchema } from './schema.mjs';
|
|
2
|
+
export interface XElse<Else extends XSchema = XSchema> {
|
|
3
3
|
else: Else;
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
6
|
* Returns true if the schema contains a valid else property
|
|
7
7
|
* @specification Json Schema 7
|
|
8
8
|
*/
|
|
9
|
-
export declare function IsElse(schema:
|
|
9
|
+
export declare function IsElse(schema: XSchemaObject): schema is XElse;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
2
|
import { Guard } from '../../guard/index.mjs';
|
|
3
|
-
import {
|
|
3
|
+
import { IsSchema } from './schema.mjs';
|
|
4
4
|
// ------------------------------------------------------------------
|
|
5
5
|
// Guard
|
|
6
6
|
// ------------------------------------------------------------------
|
|
@@ -10,5 +10,5 @@ import { IsSchemaLike } from './schema.mjs';
|
|
|
10
10
|
*/
|
|
11
11
|
export function IsElse(schema) {
|
|
12
12
|
return Guard.HasPropertyKey(schema, 'else')
|
|
13
|
-
&&
|
|
13
|
+
&& IsSchema(schema.else);
|
|
14
14
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type XSchemaObject } from './schema.mjs';
|
|
2
2
|
export interface XEnum<Enum extends unknown[] = unknown[]> {
|
|
3
3
|
enum: Enum;
|
|
4
4
|
}
|
|
@@ -6,4 +6,4 @@ export interface XEnum<Enum extends unknown[] = unknown[]> {
|
|
|
6
6
|
* Returns true if the schema contains a valid enum property
|
|
7
7
|
* @specification Json Schema 7
|
|
8
8
|
*/
|
|
9
|
-
export declare function IsEnum(schema:
|
|
9
|
+
export declare function IsEnum(schema: XSchemaObject): schema is XEnum;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type XSchemaObject } from './schema.mjs';
|
|
2
2
|
export interface XExclusiveMaximum<ExclusiveMaximum extends number | bigint = number | bigint> {
|
|
3
3
|
exclusiveMaximum: ExclusiveMaximum;
|
|
4
4
|
}
|
|
@@ -6,4 +6,4 @@ export interface XExclusiveMaximum<ExclusiveMaximum extends number | bigint = nu
|
|
|
6
6
|
* Returns true if the schema contains a valid exclusiveMaximum property
|
|
7
7
|
* @specification Json Schema 7
|
|
8
8
|
*/
|
|
9
|
-
export declare function IsExclusiveMaximum(schema:
|
|
9
|
+
export declare function IsExclusiveMaximum(schema: XSchemaObject): schema is XExclusiveMaximum;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type XSchemaObject } from './schema.mjs';
|
|
2
2
|
export interface XExclusiveMinimum<ExclusiveMinimum extends number | bigint = number | bigint> {
|
|
3
3
|
exclusiveMinimum: ExclusiveMinimum;
|
|
4
4
|
}
|
|
@@ -6,4 +6,4 @@ export interface XExclusiveMinimum<ExclusiveMinimum extends number | bigint = nu
|
|
|
6
6
|
* Returns true if the schema contains a valid exclusiveMinimum property
|
|
7
7
|
* @specification Json Schema 7
|
|
8
8
|
*/
|
|
9
|
-
export declare function IsExclusiveMinimum(schema:
|
|
9
|
+
export declare function IsExclusiveMinimum(schema: XSchemaObject): schema is XExclusiveMinimum;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type XSchemaObject } from './schema.mjs';
|
|
2
2
|
export interface XFormat<Format extends string = string> {
|
|
3
3
|
format: Format;
|
|
4
4
|
}
|
|
@@ -6,4 +6,4 @@ export interface XFormat<Format extends string = string> {
|
|
|
6
6
|
* Returns true if the schema contains a valid format property
|
|
7
7
|
* @specification Json Schema 7
|
|
8
8
|
*/
|
|
9
|
-
export declare function IsFormat(schema:
|
|
9
|
+
export declare function IsFormat(schema: XSchemaObject): schema is XFormat;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type XSchemaObject } from './schema.mjs';
|
|
2
2
|
export interface XId<Id extends string = string> {
|
|
3
3
|
$id: Id;
|
|
4
4
|
}
|
|
@@ -6,4 +6,4 @@ export interface XId<Id extends string = string> {
|
|
|
6
6
|
* Returns true if the schema contains a valid $id property
|
|
7
7
|
* @specification Json Schema 7
|
|
8
8
|
*/
|
|
9
|
-
export declare function IsId(schema:
|
|
9
|
+
export declare function IsId(schema: XSchemaObject): schema is XId;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export interface XIf<If extends
|
|
1
|
+
import { type XSchemaObject, type XSchema } from './schema.mjs';
|
|
2
|
+
export interface XIf<If extends XSchema = XSchema> {
|
|
3
3
|
if: If;
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
6
|
* Returns true if the schema contains a valid $id property
|
|
7
7
|
* @specification Json Schema 7
|
|
8
8
|
*/
|
|
9
|
-
export declare function IsIf(schema:
|
|
9
|
+
export declare function IsIf(schema: XSchemaObject): schema is XIf;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
2
|
import { Guard } from '../../guard/index.mjs';
|
|
3
|
-
import {
|
|
3
|
+
import { IsSchema } from './schema.mjs';
|
|
4
4
|
// ------------------------------------------------------------------
|
|
5
5
|
// Guard
|
|
6
6
|
// ------------------------------------------------------------------
|
|
@@ -10,5 +10,5 @@ import { IsSchemaLike } from './schema.mjs';
|
|
|
10
10
|
*/
|
|
11
11
|
export function IsIf(schema) {
|
|
12
12
|
return Guard.HasPropertyKey(schema, 'if')
|
|
13
|
-
&&
|
|
13
|
+
&& IsSchema(schema.if);
|
|
14
14
|
}
|
|
@@ -38,7 +38,6 @@ export * from './propertyNames.mjs';
|
|
|
38
38
|
export * from './ref.mjs';
|
|
39
39
|
export * from './required.mjs';
|
|
40
40
|
export * from './schema.mjs';
|
|
41
|
-
export * from './static.mjs';
|
|
42
41
|
export * from './then.mjs';
|
|
43
42
|
export * from './type.mjs';
|
|
44
43
|
export * from './uniqueItems.mjs';
|
|
@@ -44,7 +44,6 @@ export * from './propertyNames.mjs';
|
|
|
44
44
|
export * from './ref.mjs';
|
|
45
45
|
export * from './required.mjs';
|
|
46
46
|
export * from './schema.mjs';
|
|
47
|
-
export * from './static.mjs';
|
|
48
47
|
export * from './then.mjs';
|
|
49
48
|
export * from './type.mjs';
|
|
50
49
|
export * from './uniqueItems.mjs';
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export interface XItemsSized<Items extends
|
|
1
|
+
import { type XSchemaObject, type XSchema } from './schema.mjs';
|
|
2
|
+
export interface XItemsSized<Items extends XSchema[] = XSchema[]> {
|
|
3
3
|
items: Items;
|
|
4
4
|
}
|
|
5
|
-
export interface XItemsUnsized<Items extends
|
|
5
|
+
export interface XItemsUnsized<Items extends XSchema = XSchema> {
|
|
6
6
|
items: Items;
|
|
7
7
|
}
|
|
8
|
-
export interface XItems<Items extends (
|
|
8
|
+
export interface XItems<Items extends (XSchema | XSchema[]) = (XSchema | XSchema[])> {
|
|
9
9
|
items: Items;
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
12
|
* Returns true if the schema contains a valid items property
|
|
13
13
|
* @specification Json Schema 7
|
|
14
14
|
*/
|
|
15
|
-
export declare function IsItems(schema:
|
|
15
|
+
export declare function IsItems(schema: XSchemaObject): schema is XItems;
|
|
16
16
|
/** Returns true if this schema is a sized items variant */
|
|
17
|
-
export declare function IsItemsSized(schema:
|
|
17
|
+
export declare function IsItemsSized(schema: XSchemaObject): schema is XItemsSized;
|
|
18
18
|
/** Returns true if this schema is a unsized items variant */
|
|
19
|
-
export declare function IsItemsUnsized(schema:
|
|
19
|
+
export declare function IsItemsUnsized(schema: XSchemaObject): schema is XItemsUnsized;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
2
|
import { Guard } from '../../guard/index.mjs';
|
|
3
|
-
import {
|
|
3
|
+
import { IsSchema } from './schema.mjs';
|
|
4
4
|
// ------------------------------------------------------------------
|
|
5
5
|
// Guard
|
|
6
6
|
// ------------------------------------------------------------------
|
|
@@ -10,10 +10,10 @@ import { IsSchemaLike } from './schema.mjs';
|
|
|
10
10
|
*/
|
|
11
11
|
export function IsItems(schema) {
|
|
12
12
|
return Guard.HasPropertyKey(schema, 'items')
|
|
13
|
-
&& (
|
|
13
|
+
&& (IsSchema(schema.items)
|
|
14
14
|
|| (Guard.IsArray(schema.items)
|
|
15
15
|
&& schema.items.every(value => {
|
|
16
|
-
return
|
|
16
|
+
return IsSchema(value);
|
|
17
17
|
})));
|
|
18
18
|
}
|
|
19
19
|
/** Returns true if this schema is a sized items variant */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type XSchemaObject } from './schema.mjs';
|
|
2
2
|
export interface XMaxContains<MaxContains extends number = number> {
|
|
3
3
|
maxContains: MaxContains;
|
|
4
4
|
}
|
|
@@ -6,4 +6,4 @@ export interface XMaxContains<MaxContains extends number = number> {
|
|
|
6
6
|
* Returns true if the schema contains a valid maxContains property
|
|
7
7
|
* @specification Json Schema 2019-09
|
|
8
8
|
*/
|
|
9
|
-
export declare function IsMaxContains(schema:
|
|
9
|
+
export declare function IsMaxContains(schema: XSchemaObject): schema is XMaxContains;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type XSchemaObject } from './schema.mjs';
|
|
2
2
|
export interface XMaxItems<MaxItems extends number = number> {
|
|
3
3
|
maxItems: MaxItems;
|
|
4
4
|
}
|
|
@@ -6,4 +6,4 @@ export interface XMaxItems<MaxItems extends number = number> {
|
|
|
6
6
|
* Returns true if the schema contains a valid maxItems property
|
|
7
7
|
* @specification Json Schema 7
|
|
8
8
|
*/
|
|
9
|
-
export declare function IsMaxItems(schema:
|
|
9
|
+
export declare function IsMaxItems(schema: XSchemaObject): schema is XMaxItems;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type XSchemaObject } from './schema.mjs';
|
|
2
2
|
export interface XMaxLength<MaxLength extends number = number> {
|
|
3
3
|
maxLength: MaxLength;
|
|
4
4
|
}
|
|
@@ -6,4 +6,4 @@ export interface XMaxLength<MaxLength extends number = number> {
|
|
|
6
6
|
* Returns true if the schema contains a valid maxLength property
|
|
7
7
|
* @specification Json Schema 7
|
|
8
8
|
*/
|
|
9
|
-
export declare function IsMaxLength(schema:
|
|
9
|
+
export declare function IsMaxLength(schema: XSchemaObject): schema is XMaxLength;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type XSchemaObject } from './schema.mjs';
|
|
2
2
|
export interface XMaxProperties<MaxProperties extends number = number> {
|
|
3
3
|
maxProperties: MaxProperties;
|
|
4
4
|
}
|
|
@@ -6,4 +6,4 @@ export interface XMaxProperties<MaxProperties extends number = number> {
|
|
|
6
6
|
* Returns true if the schema contains a valid maxProperties property
|
|
7
7
|
* @specification Json Schema 7
|
|
8
8
|
*/
|
|
9
|
-
export declare function IsMaxProperties(schema:
|
|
9
|
+
export declare function IsMaxProperties(schema: XSchemaObject): schema is XMaxProperties;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type XSchemaObject } from './schema.mjs';
|
|
2
2
|
export interface XMaximum<Maximum extends number | bigint = number | bigint> {
|
|
3
3
|
maximum: Maximum;
|
|
4
4
|
}
|
|
@@ -6,4 +6,4 @@ export interface XMaximum<Maximum extends number | bigint = number | bigint> {
|
|
|
6
6
|
* Returns true if the schema contains a valid maximum property
|
|
7
7
|
* @specification Json Schema 7
|
|
8
8
|
*/
|
|
9
|
-
export declare function IsMaximum(schema:
|
|
9
|
+
export declare function IsMaximum(schema: XSchemaObject): schema is XMaximum;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type XSchemaObject } from './schema.mjs';
|
|
2
2
|
export interface XMinContains<MinContains extends number = number> {
|
|
3
3
|
minContains: MinContains;
|
|
4
4
|
}
|
|
@@ -6,4 +6,4 @@ export interface XMinContains<MinContains extends number = number> {
|
|
|
6
6
|
* Returns true if the schema contains a valid maxContains property
|
|
7
7
|
* @specification Json Schema 2019-09
|
|
8
8
|
*/
|
|
9
|
-
export declare function IsMinContains(schema:
|
|
9
|
+
export declare function IsMinContains(schema: XSchemaObject): schema is XMinContains;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type XSchemaObject } from './schema.mjs';
|
|
2
2
|
export interface XMinItems<MinItems extends number = number> {
|
|
3
3
|
minItems: MinItems;
|
|
4
4
|
}
|
|
@@ -6,4 +6,4 @@ export interface XMinItems<MinItems extends number = number> {
|
|
|
6
6
|
* Returns true if the schema contains a valid minItems property
|
|
7
7
|
* @specification Json Schema 7
|
|
8
8
|
*/
|
|
9
|
-
export declare function IsMinItems(schema:
|
|
9
|
+
export declare function IsMinItems(schema: XSchemaObject): schema is XMinItems;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type XSchemaObject } from './schema.mjs';
|
|
2
2
|
export interface XMinLength<MinLength extends number = number> {
|
|
3
3
|
minLength: MinLength;
|
|
4
4
|
}
|
|
@@ -6,4 +6,4 @@ export interface XMinLength<MinLength extends number = number> {
|
|
|
6
6
|
* Returns true if the schema contains a valid minLength property
|
|
7
7
|
* @specification Json Schema 7
|
|
8
8
|
*/
|
|
9
|
-
export declare function IsMinLength(schema:
|
|
9
|
+
export declare function IsMinLength(schema: XSchemaObject): schema is XMinLength;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type XSchemaObject } from './schema.mjs';
|
|
2
2
|
export interface XMinProperties<MinProperties extends number = number> {
|
|
3
3
|
minProperties: MinProperties;
|
|
4
4
|
}
|
|
@@ -6,4 +6,4 @@ export interface XMinProperties<MinProperties extends number = number> {
|
|
|
6
6
|
* Returns true if the schema contains a valid minProperties property
|
|
7
7
|
* @specification Json Schema 7
|
|
8
8
|
*/
|
|
9
|
-
export declare function IsMinProperties(schema:
|
|
9
|
+
export declare function IsMinProperties(schema: XSchemaObject): schema is XMinProperties;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type XSchemaObject } from './schema.mjs';
|
|
2
2
|
export interface XMinimum<Minimum extends number | bigint = number | bigint> {
|
|
3
3
|
minimum: Minimum;
|
|
4
4
|
}
|
|
@@ -6,4 +6,4 @@ export interface XMinimum<Minimum extends number | bigint = number | bigint> {
|
|
|
6
6
|
* Returns true if the schema contains a valid minimum property
|
|
7
7
|
* @specification Json Schema 7
|
|
8
8
|
*/
|
|
9
|
-
export declare function IsMinimum(schema:
|
|
9
|
+
export declare function IsMinimum(schema: XSchemaObject): schema is XMinimum;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type XSchemaObject } from './schema.mjs';
|
|
2
2
|
export interface XMultipleOf<MultipleOf extends number | bigint = number | bigint> {
|
|
3
3
|
multipleOf: MultipleOf;
|
|
4
4
|
}
|
|
@@ -6,4 +6,4 @@ export interface XMultipleOf<MultipleOf extends number | bigint = number | bigin
|
|
|
6
6
|
* Returns true if the schema contains a valid multipleOf property
|
|
7
7
|
* @specification Json Schema 7
|
|
8
8
|
*/
|
|
9
|
-
export declare function IsMultipleOf(schema:
|
|
9
|
+
export declare function IsMultipleOf(schema: XSchemaObject): schema is XMultipleOf;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export interface XNot<Not extends
|
|
1
|
+
import { type XSchemaObject, type XSchema } from './schema.mjs';
|
|
2
|
+
export interface XNot<Not extends XSchema = XSchema> {
|
|
3
3
|
not: Not;
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
6
|
* Returns true if the schema contains a valid not property
|
|
7
7
|
* @specification Json Schema 7
|
|
8
8
|
*/
|
|
9
|
-
export declare function IsNot(schema:
|
|
9
|
+
export declare function IsNot(schema: XSchemaObject): schema is XNot;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
2
|
import { Guard } from '../../guard/index.mjs';
|
|
3
|
-
import {
|
|
3
|
+
import { IsSchema } from './schema.mjs';
|
|
4
4
|
// ------------------------------------------------------------------
|
|
5
5
|
// Guard
|
|
6
6
|
// ------------------------------------------------------------------
|
|
@@ -10,5 +10,5 @@ import { IsSchemaLike } from './schema.mjs';
|
|
|
10
10
|
*/
|
|
11
11
|
export function IsNot(schema) {
|
|
12
12
|
return Guard.HasPropertyKey(schema, 'not')
|
|
13
|
-
&&
|
|
13
|
+
&& IsSchema(schema.not);
|
|
14
14
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export interface XOneOf<OneOf extends
|
|
1
|
+
import { type XSchemaObject, type XSchema } from './schema.mjs';
|
|
2
|
+
export interface XOneOf<OneOf extends XSchema[] = XSchema[]> {
|
|
3
3
|
oneOf: OneOf;
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
6
|
* Returns true if the schema contains a valid oneOf property
|
|
7
7
|
* @specification Json Schema 7
|
|
8
8
|
*/
|
|
9
|
-
export declare function IsOneOf(schema:
|
|
9
|
+
export declare function IsOneOf(schema: XSchemaObject): schema is XOneOf;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
2
|
import { Guard } from '../../guard/index.mjs';
|
|
3
|
-
import {
|
|
3
|
+
import { IsSchema } from './schema.mjs';
|
|
4
4
|
// ------------------------------------------------------------------
|
|
5
5
|
// Guard
|
|
6
6
|
// ------------------------------------------------------------------
|
|
@@ -11,5 +11,5 @@ import { IsSchemaLike } from './schema.mjs';
|
|
|
11
11
|
export function IsOneOf(schema) {
|
|
12
12
|
return Guard.HasPropertyKey(schema, 'oneOf')
|
|
13
13
|
&& Guard.IsArray(schema.oneOf)
|
|
14
|
-
&& schema.oneOf.every(value =>
|
|
14
|
+
&& schema.oneOf.every(value => IsSchema(value));
|
|
15
15
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type XSchemaObject } from './schema.mjs';
|
|
2
2
|
export interface XPattern<Pattern extends string | RegExp = string | RegExp> {
|
|
3
3
|
pattern: Pattern;
|
|
4
4
|
}
|
|
@@ -6,4 +6,4 @@ export interface XPattern<Pattern extends string | RegExp = string | RegExp> {
|
|
|
6
6
|
* Returns true if the schema contains a valid pattern property
|
|
7
7
|
* @specification Json Schema 7
|
|
8
8
|
*/
|
|
9
|
-
export declare function IsPattern(schema:
|
|
9
|
+
export declare function IsPattern(schema: XSchemaObject): schema is XPattern;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export interface XPatternProperties<PatternProperties extends Record<PropertyKey,
|
|
1
|
+
import { type XSchemaObject, type XSchema } from './schema.mjs';
|
|
2
|
+
export interface XPatternProperties<PatternProperties extends Record<PropertyKey, XSchema> = Record<PropertyKey, XSchema>> {
|
|
3
3
|
patternProperties: PatternProperties;
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
6
|
* Returns true if the schema contains a valid patternProperties property
|
|
7
7
|
* @specification Json Schema 7
|
|
8
8
|
*/
|
|
9
|
-
export declare function IsPatternProperties(schema:
|
|
9
|
+
export declare function IsPatternProperties(schema: XSchemaObject): schema is XPatternProperties;
|