@cfworker/json-schema 4.1.3 → 4.1.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cfworker/json-schema",
3
- "version": "4.1.3",
3
+ "version": "4.1.4",
4
4
  "description": "A JSON schema validator that will run on Cloudflare workers. Supports drafts 4, 7, 2019-09, and 2020-12.",
5
5
  "keywords": [
6
6
  "json-schema",
@@ -1 +0,0 @@
1
- export declare function deepCompareStrict(a: any, b: any): boolean;
@@ -1,12 +0,0 @@
1
- import { Schema } from './types.js';
2
- export declare const schemaKeyword: Record<string, boolean>;
3
- export declare const schemaArrayKeyword: Record<string, boolean>;
4
- export declare const schemaMapKeyword: Record<string, boolean>;
5
- export declare const ignoredKeyword: Record<string, boolean>;
6
- export declare let initialBaseURI: URL;
7
- export declare function dereference(
8
- schema: Schema | boolean,
9
- lookup?: Record<string, Schema | boolean>,
10
- baseURI?: URL,
11
- basePointer?: string
12
- ): Record<string, Schema | boolean>;
package/src/format.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare const fullFormat: Record<string, (s: string) => boolean>;
2
- export declare const fastFormat: Record<string, (s: string) => boolean>;
package/src/index.d.ts DELETED
@@ -1,8 +0,0 @@
1
- export * from './deep-compare-strict.js';
2
- export * from './dereference.js';
3
- export * from './format.js';
4
- export * from './pointer.js';
5
- export * from './types.js';
6
- export * from './ucs2-length.js';
7
- export * from './validate.js';
8
- export * from './validator.js';
package/src/pointer.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare function encodePointer(p: string): string;
2
- export declare function escapePointer(p: string): string;
package/src/types.d.ts DELETED
@@ -1,73 +0,0 @@
1
- export type SchemaDraft = '4' | '7' | '2019-09' | '2020-12';
2
- export declare const enum OutputFormat {
3
- Flag = 1,
4
- Basic = 2,
5
- Detailed = 4
6
- }
7
- export type InstanceType =
8
- 'array' | 'boolean' | 'integer' | 'null' | 'number' | 'object' | 'string';
9
- export interface Schema {
10
- $id?: string;
11
- $anchor?: string;
12
- $recursiveAnchor?: boolean;
13
- $ref?: string;
14
- $recursiveRef?: '#';
15
- $schema?: string;
16
- $comment?: string;
17
- $defs?: any;
18
- $vocabulary?: Record<string, boolean>;
19
- type?: InstanceType | InstanceType[];
20
- const?: any;
21
- enum?: any[];
22
- required?: string[];
23
- not?: Schema;
24
- anyOf?: Schema[];
25
- allOf?: Schema[];
26
- oneOf?: Schema[];
27
- if?: Schema;
28
- then?: Schema;
29
- else?: Schema;
30
- format?: string;
31
- properties?: Record<string | number, Schema | boolean>;
32
- patternProperties?: Record<string, Schema | boolean>;
33
- additionalProperties?: Schema | boolean;
34
- unevaluatedProperties?: Schema | boolean;
35
- minProperties?: number;
36
- maxProperties?: number;
37
- propertyNames?: Schema;
38
- dependentRequired?: Record<string, string[]>;
39
- dependentSchemas?: Record<string, Schema>;
40
- dependencies?: Record<string, Schema | string[]>;
41
- prefixItems?: Array<Schema | boolean>;
42
- items?: Schema | boolean | Array<Schema | boolean>;
43
- additionalItems?: Schema | boolean;
44
- unevaluatedItems?: Schema | boolean;
45
- contains?: Schema | boolean;
46
- minContains?: number;
47
- maxContains?: number;
48
- minItems?: number;
49
- maxItems?: number;
50
- uniqueItems?: boolean;
51
- minimum?: number;
52
- maximum?: number;
53
- exclusiveMinimum?: number | boolean;
54
- exclusiveMaximum?: number | boolean;
55
- multipleOf?: number;
56
- minLength?: number;
57
- maxLength?: number;
58
- pattern?: string;
59
- __absolute_ref__?: string;
60
- __absolute_recursive_ref__?: string;
61
- __absolute_uri__?: string;
62
- [key: string]: any;
63
- }
64
- export interface OutputUnit {
65
- keyword: string;
66
- keywordLocation: string;
67
- instanceLocation: string;
68
- error: string;
69
- }
70
- export interface ValidationResult {
71
- valid: boolean;
72
- errors: OutputUnit[];
73
- }
@@ -1 +0,0 @@
1
- export declare function ucs2length(s: string): number;
package/src/validate.d.ts DELETED
@@ -1,13 +0,0 @@
1
- import { Schema, SchemaDraft, ValidationResult } from './types.js';
2
- export type Evaluated = Record<string | number, boolean>;
3
- export declare function validate(
4
- instance: any,
5
- schema: Schema | boolean,
6
- draft?: SchemaDraft,
7
- lookup?: Record<string, Schema | boolean>,
8
- shortCircuit?: boolean,
9
- recursiveAnchor?: Schema | null,
10
- instanceLocation?: string,
11
- schemaLocation?: string,
12
- evaluated?: Evaluated
13
- ): ValidationResult;
@@ -1,14 +0,0 @@
1
- import { Schema, SchemaDraft, ValidationResult } from './types.js';
2
- export declare class Validator {
3
- private readonly schema;
4
- private readonly draft;
5
- private readonly shortCircuit;
6
- private readonly lookup;
7
- constructor(
8
- schema: Schema | boolean,
9
- draft?: SchemaDraft,
10
- shortCircuit?: boolean
11
- );
12
- validate(instance: any): ValidationResult;
13
- addSchema(schema: Schema, id?: string): void;
14
- }