Socket
Socket
Sign inDemoInstall

ajv

Package Overview
Dependencies
5
Maintainers
2
Versions
350
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 8.11.2 to 8.12.0

10

dist/compile/codegen/code.d.ts

@@ -25,8 +25,8 @@ export declare abstract class _CodeOrName {

}
export declare type CodeItem = Name | string | number | boolean | null;
export declare type UsedNames = Record<string, number | undefined>;
export declare type Code = _Code | Name;
export declare type SafeExpr = Code | number | boolean | null;
export type CodeItem = Name | string | number | boolean | null;
export type UsedNames = Record<string, number | undefined>;
export type Code = _Code | Name;
export type SafeExpr = Code | number | boolean | null;
export declare const nil: _Code;
declare type CodeArg = SafeExpr | string | undefined;
type CodeArg = SafeExpr | string | undefined;
export declare function _(strs: TemplateStringsArray, ...args: CodeArg[]): _Code;

@@ -33,0 +33,0 @@ export declare function str(strs: TemplateStringsArray, ...args: (CodeArg | string[])[]): _Code;

@@ -6,4 +6,4 @@ import type { ScopeValueSets, NameValue, ValueScope, ValueScopeName } from "./scope";

export { Scope, ScopeStore, ValueScope, ValueScopeName, ScopeValueSets, varKinds } from "./scope";
export declare type SafeExpr = Code | number | boolean | null;
export declare type Block = Code | (() => void);
export type SafeExpr = Code | number | boolean | null;
export type Block = Code | (() => void);
export declare const operators: {

@@ -10,0 +10,0 @@ GT: _Code;

@@ -11,3 +11,3 @@ import { Code, Name } from "./code";

}
export declare type ValueReference = unknown;
export type ValueReference = unknown;
interface ScopeOptions {

@@ -22,7 +22,7 @@ prefixes?: Set<string>;

}
export declare type ScopeStore = Record<string, ValueReference[] | undefined>;
declare type ScopeValues = {
export type ScopeStore = Record<string, ValueReference[] | undefined>;
type ScopeValues = {
[Prefix in string]?: Map<unknown, ValueScopeName>;
};
export declare type ScopeValueSets = {
export type ScopeValueSets = {
[Prefix in string]?: Set<ValueScopeName>;

@@ -34,3 +34,3 @@ };

}
export declare type UsedScopeValues = {
export type UsedScopeValues = {
[Prefix in string]?: Map<ValueScopeName, UsedValueState | undefined>;

@@ -37,0 +37,0 @@ };

@@ -7,3 +7,3 @@ import type { AnySchema, AnySchemaObject, AnyValidateFunction, EvaluatedProperties, EvaluatedItems } from "../types";

import { JSONType } from "./rules";
export declare type SchemaRefs = {
export type SchemaRefs = {
[Ref in string]?: SchemaEnv | AnySchema;

@@ -10,0 +10,0 @@ };

@@ -137,11 +137,21 @@ "use strict";

let first = !discriminator;
let firstProp;
for (const key of props) {
if (first)
first = false;
else
gen.add(names_1.default.json, (0, codegen_1.str) `,`);
serializeProperty(key, properties[key], keyValue(key));
}
if (first)
firstProp = gen.let("first", true);
for (const key of optProps) {
const value = keyValue(key);
gen.if((0, codegen_1.and)((0, codegen_1._) `${value} !== undefined`, (0, code_1.isOwnProperty)(gen, data, key)), () => serializeProperty(key, optionalProperties[key], value));
gen.if((0, codegen_1.and)((0, codegen_1._) `${value} !== undefined`, (0, code_1.isOwnProperty)(gen, data, key)), () => {
addComma(cxt, firstProp);
serializeProperty(key, optionalProperties[key], value);
});
}
if (schema.additionalProperties) {
gen.forIn("key", data, (key) => gen.if(isAdditional(key, allProps), () => serializeKeyValue(cxt, key, {}, gen.let("first", first))));
gen.forIn("key", data, (key) => gen.if(isAdditional(key, allProps), () => serializeKeyValue(cxt, key, {}, firstProp)));
}

@@ -163,6 +173,2 @@ function keys(ps) {

function serializeProperty(key, propSchema, value) {
if (first)
first = false;
else
gen.add(names_1.default.json, (0, codegen_1.str) `,`);
gen.add(names_1.default.json, (0, codegen_1.str) `${JSON.stringify(key)}:`);

@@ -218,4 +224,9 @@ serializeCode({ ...cxt, schema: propSchema, data: value });

function addComma({ gen }, first) {
gen.if(first, () => gen.assign(first, false), () => gen.add(names_1.default.json, (0, codegen_1.str) `,`));
if (first) {
gen.if(first, () => gen.assign(first, false), () => gen.add(names_1.default.json, (0, codegen_1.str) `,`));
}
else {
gen.add(names_1.default.json, (0, codegen_1.str) `,`);
}
}
//# sourceMappingURL=serialize.js.map
import type { SchemaObject } from "../../types";
export declare type SchemaObjectMap = {
export type SchemaObjectMap = {
[Ref in string]?: SchemaObject;
};
export declare const jtdForms: readonly ["elements", "values", "discriminator", "properties", "optionalProperties", "enum", "type", "ref"];
export declare type JTDForm = typeof jtdForms[number];
export type JTDForm = typeof jtdForms[number];
import type { AnySchema, AnySchemaObject, UriResolver } from "../types";
import type Ajv from "../ajv";
import type { URIComponents } from "uri-js";
export declare type LocalRefs = {
export type LocalRefs = {
[Ref in string]?: AnySchemaObject;

@@ -6,0 +6,0 @@ };

import type { AddedKeywordDefinition } from "../types";
declare const _jsonTypes: readonly ["string", "number", "integer", "boolean", "null", "object", "array"];
export declare type JSONType = typeof _jsonTypes[number];
export type JSONType = typeof _jsonTypes[number];
export declare function isJSONType(x: unknown): x is JSONType;
declare type ValidationTypes = {
type ValidationTypes = {
[K in JSONType]: boolean | RuleGroup | undefined;

@@ -7,0 +7,0 @@ };

@@ -20,4 +20,4 @@ import type { AnySchema, EvaluatedProperties, EvaluatedItems } from "../types";

export declare function eachItem<T>(xs: T | T[], f: (x: T) => void): void;
declare type SomeEvaluated = EvaluatedProperties | EvaluatedItems;
declare type MergeEvaluatedFunc<T extends SomeEvaluated> = (gen: CodeGen, from: Name | T, to: Name | Exclude<T, true> | undefined, toName?: typeof Name) => Name | T;
type SomeEvaluated = EvaluatedProperties | EvaluatedItems;
type MergeEvaluatedFunc<T extends SomeEvaluated> = (gen: CodeGen, from: Name | T, to: Name | Exclude<T, true> | undefined, toName?: typeof Name) => Name | T;
interface MergeEvaluated {

@@ -24,0 +24,0 @@ props: MergeEvaluatedFunc<EvaluatedProperties>;

@@ -14,5 +14,5 @@ import type { ErrorObject, AnySchemaObject } from "../../types";

export declare function checkDataTypes(dataTypes: JSONType[], data: Name, strictNums?: boolean | "log", correct?: DataType): Code;
export declare type TypeError = ErrorObject<"type", {
export type TypeError = ErrorObject<"type", {
type: string;
}>;
export declare function reportTypeError(it: SchemaObjCxt): void;

@@ -247,3 +247,3 @@ "use strict";

});
it.dataTypes = it.dataTypes.filter((t) => includesType(types, t));
narrowSchemaTypes(it, types);
}

@@ -273,2 +273,12 @@ function checkMultipleTypes(it, ts) {

}
function narrowSchemaTypes(it, withTypes) {
const ts = [];
for (const t of it.dataTypes) {
if (includesType(withTypes, t))
ts.push(t);
else if (withTypes.includes("integer") && t === "number")
ts.push("integer");
}
it.dataTypes = ts;
}
function strictTypesError(it, msg) {

@@ -275,0 +285,0 @@ const schemaPath = it.schemaEnv.baseId + it.errSchemaPath;

@@ -26,3 +26,3 @@ import type { AnySchema } from "../../types";

}
export declare type SubschemaArgs = Partial<{
export type SubschemaArgs = Partial<{
keyword: string;

@@ -29,0 +29,0 @@ schemaProp: string | number;

@@ -21,3 +21,3 @@ export { Format, FormatDefinition, AsyncFormatDefinition, KeywordDefinition, KeywordErrorDefinition, CodeKeywordDefinition, MacroKeywordDefinition, FuncKeywordDefinition, Vocabulary, Schema, SchemaObject, AnySchemaObject, AsyncSchema, AnySchema, ValidateFunction, AsyncValidateFunction, AnyValidateFunction, ErrorObject, ErrorNoParams, } from "./types";

import { Code, ValueScope } from "./compile/codegen";
export declare type Options = CurrentOptions & DeprecatedOptions;
export type Options = CurrentOptions & DeprecatedOptions;
export interface CurrentOptions {

@@ -96,3 +96,3 @@ strict?: boolean | "log";

}
declare type RequiredInstanceOptions = {
type RequiredInstanceOptions = {
[K in "strictSchema" | "strictNumbers" | "strictTypes" | "strictTuples" | "strictRequired" | "inlineRefs" | "loopRequired" | "loopEnum" | "meta" | "messages" | "schemaId" | "addUsedSchema" | "validateSchema" | "validateFormats" | "int32range" | "unicodeRegExp" | "uriResolver"]: NonNullable<Options[K]>;

@@ -102,3 +102,3 @@ } & {

};
export declare type InstanceOptions = Options & RequiredInstanceOptions;
export type InstanceOptions = Options & RequiredInstanceOptions;
export interface Logger {

@@ -105,0 +105,0 @@ log(...args: unknown[]): unknown;

import type { AnySchemaObject, SchemaObject, JTDParser } from "./types";
import type { JTDSchemaType, SomeJTDSchemaType, JTDDataType } from "./types/jtd-schema";
import AjvCore, { CurrentOptions } from "./core";
declare type JTDOptions = CurrentOptions & {
type JTDOptions = CurrentOptions & {
strict?: never;

@@ -6,0 +6,0 @@ allowMatchingProperties?: never;

import * as equal from "fast-deep-equal";
declare type Equal = typeof equal & {
type Equal = typeof equal & {
code: string;

@@ -4,0 +4,0 @@ };

import * as re2 from "re2";
declare type Re2 = typeof re2 & {
type Re2 = typeof re2 & {
code: string;

@@ -4,0 +4,0 @@ };

import * as uri from "uri-js";
declare type URI = typeof uri & {
type URI = typeof uri & {
code: string;

@@ -4,0 +4,0 @@ };

@@ -23,6 +23,6 @@ import * as URI from "uri-js";

}
export declare type AnySchemaObject = SchemaObject | AsyncSchema;
export declare type Schema = SchemaObject | boolean;
export declare type AnySchema = Schema | AsyncSchema;
export declare type SchemaMap = {
export type AnySchemaObject = SchemaObject | AsyncSchema;
export type Schema = SchemaObject | boolean;
export type AnySchema = Schema | AsyncSchema;
export type SchemaMap = {
[Key in string]?: AnySchema;

@@ -60,6 +60,6 @@ };

}
export declare type EvaluatedProperties = {
export type EvaluatedProperties = {
[K in string]?: true;
} | true;
export declare type EvaluatedItems = number | true;
export type EvaluatedItems = number | true;
export interface Evaluated {

@@ -75,3 +75,3 @@ props?: EvaluatedProperties;

}
export declare type AnyValidateFunction<T = any> = ValidateFunction<T> | AsyncValidateFunction<T>;
export type AnyValidateFunction<T = any> = ValidateFunction<T> | AsyncValidateFunction<T>;
export interface ErrorObject<K extends string = string, P = Record<string, any>, S = unknown> {

@@ -88,3 +88,3 @@ keyword: K;

}
export declare type ErrorNoParams<K extends string, S = unknown> = ErrorObject<K, Record<string, never>, S>;
export type ErrorNoParams<K extends string, S = unknown> = ErrorObject<K, Record<string, never>, S>;
interface _KeywordDef {

@@ -109,4 +109,4 @@ keyword: string | string[];

}
export declare type MacroKeywordFunc = (schema: any, parentSchema: AnySchemaObject, it: SchemaCxt) => AnySchema;
export declare type CompileKeywordFunc = (schema: any, parentSchema: AnySchemaObject, it: SchemaObjCxt) => DataValidateFunction;
export type MacroKeywordFunc = (schema: any, parentSchema: AnySchemaObject, it: SchemaCxt) => AnySchema;
export type CompileKeywordFunc = (schema: any, parentSchema: AnySchemaObject, it: SchemaObjCxt) => DataValidateFunction;
export interface DataValidateFunction {

@@ -132,4 +132,4 @@ (...args: Parameters<ValidateFunction>): boolean | Promise<any>;

}
export declare type KeywordDefinition = CodeKeywordDefinition | FuncKeywordDefinition | MacroKeywordDefinition;
export declare type AddedKeywordDefinition = KeywordDefinition & {
export type KeywordDefinition = CodeKeywordDefinition | FuncKeywordDefinition | MacroKeywordDefinition;
export type AddedKeywordDefinition = KeywordDefinition & {
type: JSONType[];

@@ -142,3 +142,3 @@ schemaType: JSONType[];

}
export declare type Vocabulary = (KeywordDefinition | string)[];
export type Vocabulary = (KeywordDefinition | string)[];
export interface KeywordErrorCxt {

@@ -158,8 +158,8 @@ gen: CodeGen;

}
export declare type KeywordCxtParams = {
export type KeywordCxtParams = {
[P in string]?: Code | string | number;
};
export declare type FormatValidator<T extends string | number> = (data: T) => boolean;
export declare type FormatCompare<T extends string | number> = (data1: T, data2: T) => number | undefined;
export declare type AsyncFormatValidator<T extends string | number> = (data: T) => Promise<boolean>;
export type FormatValidator<T extends string | number> = (data: T) => boolean;
export type FormatCompare<T extends string | number> = (data1: T, data2: T) => number | undefined;
export type AsyncFormatValidator<T extends string | number> = (data: T) => Promise<boolean>;
export interface FormatDefinition<T extends string | number> {

@@ -177,4 +177,4 @@ type?: T extends string ? "string" | undefined : "number";

}
export declare type AddedFormat = true | RegExp | FormatValidator<string> | FormatDefinition<string> | FormatDefinition<number> | AsyncFormatDefinition<string> | AsyncFormatDefinition<number>;
export declare type Format = AddedFormat | string;
export type AddedFormat = true | RegExp | FormatValidator<string> | FormatDefinition<string> | FormatDefinition<number> | AsyncFormatDefinition<string> | AsyncFormatDefinition<number>;
export type Format = AddedFormat | string;
export interface RegExpEngine {

@@ -181,0 +181,0 @@ (pattern: string, u: string): RegExpLike;

@@ -1,7 +0,7 @@

declare type StrictNullChecksWrapper<Name extends string, Type> = undefined extends null ? `strictNullChecks must be true in tsconfig to use ${Name}` : Type;
declare type UnionToIntersection<U> = (U extends any ? (_: U) => void : never) extends (_: infer I) => void ? I : never;
export declare type SomeJSONSchema = UncheckedJSONSchemaType<Known, true>;
declare type UncheckedPartialSchema<T> = Partial<UncheckedJSONSchemaType<T, true>>;
export declare type PartialSchema<T> = StrictNullChecksWrapper<"PartialSchema", UncheckedPartialSchema<T>>;
declare type JSONType<T extends string, IsPartial extends boolean> = IsPartial extends true ? T | undefined : T;
type StrictNullChecksWrapper<Name extends string, Type> = undefined extends null ? `strictNullChecks must be true in tsconfig to use ${Name}` : Type;
type UnionToIntersection<U> = (U extends any ? (_: U) => void : never) extends (_: infer I) => void ? I : never;
export type SomeJSONSchema = UncheckedJSONSchemaType<Known, true>;
type UncheckedPartialSchema<T> = Partial<UncheckedJSONSchemaType<T, true>>;
export type PartialSchema<T> = StrictNullChecksWrapper<"PartialSchema", UncheckedPartialSchema<T>>;
type JSONType<T extends string, IsPartial extends boolean> = IsPartial extends true ? T | undefined : T;
interface NumberKeywords {

@@ -21,3 +21,3 @@ minimum?: number;

}
declare type UncheckedJSONSchemaType<T, IsPartial extends boolean> = (// these two unions allow arbitrary unions of types
type UncheckedJSONSchemaType<T, IsPartial extends boolean> = (// these two unions allow arbitrary unions of types
{

@@ -101,7 +101,7 @@ anyOf: readonly UncheckedJSONSchemaType<T, IsPartial>[];

};
export declare type JSONSchemaType<T> = StrictNullChecksWrapper<"JSONSchemaType", UncheckedJSONSchemaType<T, false>>;
declare type Known = {
export type JSONSchemaType<T> = StrictNullChecksWrapper<"JSONSchemaType", UncheckedJSONSchemaType<T, false>>;
type Known = {
[key: string]: Known;
} | [Known, ...Known[]] | Known[] | number | string | boolean | null;
declare type UncheckedPropertiesSchema<T> = {
type UncheckedPropertiesSchema<T> = {
[K in keyof T]-?: (UncheckedJSONSchemaType<T[K], false> & Nullable<T[K]>) | {

@@ -111,8 +111,8 @@ $ref: string;

};
export declare type PropertiesSchema<T> = StrictNullChecksWrapper<"PropertiesSchema", UncheckedPropertiesSchema<T>>;
declare type UncheckedRequiredMembers<T> = {
export type PropertiesSchema<T> = StrictNullChecksWrapper<"PropertiesSchema", UncheckedPropertiesSchema<T>>;
type UncheckedRequiredMembers<T> = {
[K in keyof T]-?: undefined extends T[K] ? never : K;
}[keyof T];
export declare type RequiredMembers<T> = StrictNullChecksWrapper<"RequiredMembers", UncheckedRequiredMembers<T>>;
declare type Nullable<T> = undefined extends T ? {
export type RequiredMembers<T> = StrictNullChecksWrapper<"RequiredMembers", UncheckedRequiredMembers<T>>;
type Nullable<T> = undefined extends T ? {
nullable: true;

@@ -119,0 +119,0 @@ const?: null;

/** numeric strings */
declare type NumberType = "float32" | "float64" | "int8" | "uint8" | "int16" | "uint16" | "int32" | "uint32";
type NumberType = "float32" | "float64" | "int8" | "uint8" | "int16" | "uint16" | "int32" | "uint32";
/** string strings */
declare type StringType = "string" | "timestamp";
type StringType = "string" | "timestamp";
/** Generic JTD Schema without inference of the represented type */
export declare type SomeJTDSchemaType = (// ref
export type SomeJTDSchemaType = (// ref
{

@@ -34,28 +34,30 @@ ref: string;

/** required keys of an object, not undefined */
declare type RequiredKeys<T> = {
type RequiredKeys<T> = {
[K in keyof T]-?: undefined extends T[K] ? never : K;
}[keyof T];
/** optional or undifined-able keys of an object */
declare type OptionalKeys<T> = {
type OptionalKeys<T> = {
[K in keyof T]-?: undefined extends T[K] ? K : never;
}[keyof T];
/** type is true if T is a union type */
declare type IsUnion_<T, U extends T = T> = false extends (T extends unknown ? ([U] extends [T] ? false : true) : never) ? false : true;
declare type IsUnion<T> = IsUnion_<T>;
type IsUnion_<T, U extends T = T> = false extends (T extends unknown ? ([U] extends [T] ? false : true) : never) ? false : true;
type IsUnion<T> = IsUnion_<T>;
/** type is true if T is identically E */
declare type TypeEquality<T, E> = [T] extends [E] ? ([E] extends [T] ? true : false) : false;
type TypeEquality<T, E> = [T] extends [E] ? ([E] extends [T] ? true : false) : false;
/** type is true if T or null is identically E or null*/
declare type NullTypeEquality<T, E> = TypeEquality<T | null, E | null>;
type NullTypeEquality<T, E> = TypeEquality<T | null, E | null>;
/** gets only the string literals of a type or null if a type isn't a string literal */
declare type EnumString<T> = [T] extends [never] ? null : T extends string ? string extends T ? null : T : null;
type EnumString<T> = [T] extends [never] ? null : T extends string ? string extends T ? null : T : null;
/** true if type is a union of string literals */
declare type IsEnum<T> = null extends EnumString<Exclude<T, null>> ? false : true;
type IsEnum<T> = null extends EnumString<T> ? false : true;
/** true only if all types are array types (not tuples) */
declare type IsElements<T> = false extends IsUnion<T> ? [T] extends [readonly unknown[]] ? undefined extends T[0.5] ? false : true : false : false;
type IsElements<T> = false extends IsUnion<T> ? [T] extends [readonly unknown[]] ? undefined extends T[0.5] ? false : true : false : false;
/** true if the the type is a values type */
declare type IsValues<T> = false extends IsUnion<Exclude<T, null>> ? TypeEquality<keyof Exclude<T, null>, string> : false;
/** true if type is a proeprties type and Union is false, or type is a discriminator type and Union is true */
declare type IsRecord<T, Union extends boolean> = Union extends IsUnion<Exclude<T, null>> ? null extends EnumString<keyof Exclude<T, null>> ? false : true : false;
type IsValues<T> = false extends IsUnion<T> ? TypeEquality<keyof T, string> : false;
/** true if type is a properties type and Union is false, or type is a discriminator type and Union is true */
type IsRecord<T, Union extends boolean> = Union extends IsUnion<T> ? null extends EnumString<keyof T> ? false : true : false;
/** true if type represents an empty record */
type IsEmptyRecord<T> = [T] extends [Record<string, never>] ? [T] extends [never] ? false : true : false;
/** actual schema */
export declare type JTDSchemaType<T, D extends Record<string, unknown> = Record<string, never>> = (// refs - where null wasn't specified, must match exactly
export type JTDSchemaType<T, D extends Record<string, unknown> = Record<string, never>> = (// refs - where null wasn't specified, must match exactly
(null extends EnumString<keyof D> ? never : ({

@@ -83,9 +85,14 @@ [K in keyof D]: [T] extends [D[K]] ? {

type: "timestamp";
} : true extends IsEnum<T> ? {
} : true extends IsEnum<Exclude<T, null>> ? {
enum: EnumString<Exclude<T, null>>[];
} : true extends IsElements<Exclude<T, null>> ? T extends readonly (infer E)[] ? {
elements: JTDSchemaType<E, D>;
} : never : true extends IsValues<T> ? T extends Record<string, infer V> ? {
} : never : true extends IsEmptyRecord<Exclude<T, null>> ? {
properties: Record<string, never>;
optionalProperties?: Record<string, never>;
} | {
optionalProperties: Record<string, never>;
} : true extends IsValues<Exclude<T, null>> ? T extends Record<string, infer V> ? {
values: JTDSchemaType<V, D>;
} : never : true extends IsRecord<T, false> ? ([RequiredKeys<Exclude<T, null>>] extends [never] ? {
} : never : true extends IsRecord<Exclude<T, null>, false> ? ([RequiredKeys<Exclude<T, null>>] extends [never] ? {
properties?: Record<string, never>;

@@ -104,9 +111,7 @@ } : {

additionalProperties?: boolean;
} : true extends IsRecord<T, true> ? {
} : true extends IsRecord<Exclude<T, null>, true> ? {
[K in keyof Exclude<T, null>]-?: Exclude<T, null>[K] extends string ? {
discriminator: K;
mapping: {
[M in Exclude<T, null>[K]]: JTDSchemaType<Omit<T extends {
[C in K]: M;
} ? T : never, K>, D>;
[M in Exclude<T, null>[K]]: JTDSchemaType<Omit<T extends Record<K, M> ? T : never, K>, D>;
};

@@ -124,3 +129,3 @@ } : never;

};
declare type JTDDataDef<S, D extends Record<string, unknown>> = // ref
type JTDDataDef<S, D extends Record<string, unknown>> = // ref
(S extends {

@@ -170,5 +175,5 @@ ref: string;

} ? null : never);
export declare type JTDDataType<S> = S extends {
export type JTDDataType<S> = S extends {
definitions: Record<string, unknown>;
} ? JTDDataDef<S, S["definitions"]> : JTDDataDef<S, Record<string, never>>;
export {};
import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types";
import type { KeywordCxt } from "../../compile/validate";
export declare type AdditionalItemsError = ErrorObject<"additionalItems", {
export type AdditionalItemsError = ErrorObject<"additionalItems", {
limit: number;

@@ -5,0 +5,0 @@ }, AnySchema>;

import type { CodeKeywordDefinition, AddedKeywordDefinition, ErrorObject, AnySchema } from "../../types";
export declare type AdditionalPropertiesError = ErrorObject<"additionalProperties", {
export type AdditionalPropertiesError = ErrorObject<"additionalProperties", {
additionalProperty: string;

@@ -4,0 +4,0 @@ }, AnySchema>;

import type { CodeKeywordDefinition, ErrorNoParams, AnySchema } from "../../types";
export declare type AnyOfError = ErrorNoParams<"anyOf", AnySchema[]>;
export type AnyOfError = ErrorNoParams<"anyOf", AnySchema[]>;
declare const def: CodeKeywordDefinition;
export default def;
import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types";
export declare type ContainsError = ErrorObject<"contains", {
export type ContainsError = ErrorObject<"contains", {
minContains: number;

@@ -4,0 +4,0 @@ maxContains?: number;

import type { CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition, SchemaMap, AnySchema } from "../../types";
import type { KeywordCxt } from "../../compile/validate";
export declare type PropertyDependencies = {
export type PropertyDependencies = {
[K in string]?: string[];

@@ -12,3 +12,3 @@ };

}
export declare type DependenciesError = ErrorObject<"dependencies", DependenciesErrorParams, {
export type DependenciesError = ErrorObject<"dependencies", DependenciesErrorParams, {
[K in string]?: string[] | AnySchema;

@@ -15,0 +15,0 @@ }>;

import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types";
export declare type IfKeywordError = ErrorObject<"if", {
export type IfKeywordError = ErrorObject<"if", {
failingKeyword: string;

@@ -4,0 +4,0 @@ }, AnySchema>;

@@ -13,2 +13,2 @@ import type { ErrorNoParams, Vocabulary } from "../../types";

export default function getApplicator(draft2020?: boolean): Vocabulary;
export declare type ApplicatorKeywordError = ErrorNoParams<"false schema"> | AdditionalItemsError | ItemsError | ContainsError | AdditionalPropertiesError | DependenciesError | IfKeywordError | AnyOfError | OneOfError | NotKeywordError | PropertyNamesError;
export type ApplicatorKeywordError = ErrorNoParams<"false schema"> | AdditionalItemsError | ItemsError | ContainsError | AdditionalPropertiesError | DependenciesError | IfKeywordError | AnyOfError | OneOfError | NotKeywordError | PropertyNamesError;
import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types";
export declare type ItemsError = ErrorObject<"items", {
export type ItemsError = ErrorObject<"items", {
limit: number;

@@ -4,0 +4,0 @@ }, AnySchema>;

import type { CodeKeywordDefinition, ErrorNoParams, AnySchema } from "../../types";
export declare type NotKeywordError = ErrorNoParams<"not", AnySchema>;
export type NotKeywordError = ErrorNoParams<"not", AnySchema>;
declare const def: CodeKeywordDefinition;
export default def;
import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types";
export declare type OneOfError = ErrorObject<"oneOf", {
export type OneOfError = ErrorObject<"oneOf", {
passingSchemas: [number, number] | null;

@@ -4,0 +4,0 @@ }, AnySchema[]>;

import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types";
export declare type PropertyNamesError = ErrorObject<"propertyNames", {
export type PropertyNamesError = ErrorObject<"propertyNames", {
propertyName: string;

@@ -4,0 +4,0 @@ }, AnySchema>;

import type { CodeKeywordDefinition } from "../../types";
import { DiscrError, DiscrErrorObj } from "../discriminator/types";
export declare type DiscriminatorError = DiscrErrorObj<DiscrError.Tag> | DiscrErrorObj<DiscrError.Mapping>;
export type DiscriminatorError = DiscrErrorObj<DiscrError.Tag> | DiscrErrorObj<DiscrError.Mapping>;
declare const def: CodeKeywordDefinition;
export default def;

@@ -6,3 +6,3 @@ import type { ErrorObject } from "../../types";

}
export declare type DiscrErrorObj<E extends DiscrError> = ErrorObject<"discriminator", {
export type DiscrErrorObj<E extends DiscrError> = ErrorObject<"discriminator", {
error: E;

@@ -9,0 +9,0 @@ tag: string;

@@ -9,2 +9,2 @@ import type { TypeError } from "../compile/validate/dataType";

import type { DiscriminatorError } from "./discriminator";
export declare type DefinedError = TypeError | ApplicatorKeywordError | ValidationKeywordError | FormatError | UnevaluatedPropertiesError | UnevaluatedItemsError | DependentRequiredError | DiscriminatorError;
export type DefinedError = TypeError | ApplicatorKeywordError | ValidationKeywordError | FormatError | UnevaluatedPropertiesError | UnevaluatedItemsError | DependentRequiredError | DiscriminatorError;
import type { CodeKeywordDefinition, ErrorObject } from "../../types";
export declare type FormatError = ErrorObject<"format", {
export type FormatError = ErrorObject<"format", {
format: string;

@@ -4,0 +4,0 @@ }, string | {

import type { CodeKeywordDefinition } from "../../types";
import { _JTDTypeError } from "./error";
import { DiscrError, DiscrErrorObj } from "../discriminator/types";
export declare type JTDDiscriminatorError = _JTDTypeError<"discriminator", "object", string> | DiscrErrorObj<DiscrError.Tag> | DiscrErrorObj<DiscrError.Mapping>;
export type JTDDiscriminatorError = _JTDTypeError<"discriminator", "object", string> | DiscrErrorObj<DiscrError.Tag> | DiscrErrorObj<DiscrError.Mapping>;
declare const def: CodeKeywordDefinition;
export default def;
import type { CodeKeywordDefinition, SchemaObject } from "../../types";
import { _JTDTypeError } from "./error";
export declare type JTDElementsError = _JTDTypeError<"elements", "array", SchemaObject>;
export type JTDElementsError = _JTDTypeError<"elements", "array", SchemaObject>;
declare const def: CodeKeywordDefinition;
export default def;
import type { CodeKeywordDefinition, ErrorObject } from "../../types";
export declare type JTDEnumError = ErrorObject<"enum", {
export type JTDEnumError = ErrorObject<"enum", {
allowedValues: string[];

@@ -4,0 +4,0 @@ }, string[]>;

import type { KeywordErrorDefinition, KeywordErrorCxt, ErrorObject } from "../../types";
import { Code } from "../../compile/codegen";
export declare type _JTDTypeError<K extends string, T extends string, S> = ErrorObject<K, {
export type _JTDTypeError<K extends string, T extends string, S> = ErrorObject<K, {
type: T;

@@ -5,0 +5,0 @@ nullable: boolean;

@@ -10,2 +10,2 @@ import type { Vocabulary } from "../../types";

export default jtdVocabulary;
export declare type JTDErrorObject = JTDTypeError | JTDEnumError | JTDElementsError | JTDPropertiesError | JTDDiscriminatorError | JTDValuesError;
export type JTDErrorObject = JTDTypeError | JTDEnumError | JTDElementsError | JTDPropertiesError | JTDDiscriminatorError | JTDValuesError;

@@ -8,7 +8,7 @@ import type { CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition, SchemaObject } from "../../types";

}
declare type PropKeyword = "properties" | "optionalProperties";
declare type PropSchema = {
type PropKeyword = "properties" | "optionalProperties";
type PropSchema = {
[P in string]?: SchemaObject;
};
export declare type JTDPropertiesError = _JTDTypeError<PropKeyword, "object", PropSchema> | ErrorObject<PropKeyword, {
export type JTDPropertiesError = _JTDTypeError<PropKeyword, "object", PropSchema> | ErrorObject<PropKeyword, {
error: PropError.Additional;

@@ -15,0 +15,0 @@ additionalProperty: string;

@@ -112,4 +112,3 @@ "use strict";

gen.forIn("key", data, (key) => {
const _allProps = it.jtdDiscriminator === undefined ? allProps : [it.jtdDiscriminator].concat(allProps);
const addProp = isAdditional(key, _allProps, "properties");
const addProp = isAdditional(key, allProps, "properties", it.jtdDiscriminator);
const addOptProp = isAdditional(key, allOptProps, "optionalProperties");

@@ -129,3 +128,3 @@ const extra = addProp === true ? addOptProp : addOptProp === true ? addProp : (0, codegen_1.and)(addProp, addOptProp);

}
function isAdditional(key, props, keyword) {
function isAdditional(key, props, keyword, jtdDiscriminator) {
let additional;

@@ -136,5 +135,9 @@ if (props.length > 8) {

additional = (0, codegen_1.not)((0, code_1.isOwnProperty)(gen, propsSchema, key));
if (jtdDiscriminator !== undefined) {
additional = (0, codegen_1.and)(additional, (0, codegen_1._) `${key} !== ${jtdDiscriminator}`);
}
}
else if (props.length) {
additional = (0, codegen_1.and)(...props.map((p) => (0, codegen_1._) `${key} !== ${p}`));
else if (props.length || jtdDiscriminator !== undefined) {
const ps = jtdDiscriminator === undefined ? props : [jtdDiscriminator].concat(props);
additional = (0, codegen_1.and)(...ps.map((p) => (0, codegen_1._) `${key} !== ${p}`));
}

@@ -141,0 +144,0 @@ else {

import type { CodeKeywordDefinition } from "../../types";
import { _JTDTypeError } from "./error";
export declare type JTDTypeError = _JTDTypeError<"type", JTDType, JTDType>;
export declare type IntType = "int8" | "uint8" | "int16" | "uint16" | "int32" | "uint32";
export type JTDTypeError = _JTDTypeError<"type", JTDType, JTDType>;
export type IntType = "int8" | "uint8" | "int16" | "uint16" | "int32" | "uint32";
export declare const intRange: {
[T in IntType]: [number, number, number];
};
export declare type JTDType = "boolean" | "string" | "timestamp" | "float32" | "float64" | IntType;
export type JTDType = "boolean" | "string" | "timestamp" | "float32" | "float64" | IntType;
declare const def: CodeKeywordDefinition;
export default def;
import type { CodeKeywordDefinition, SchemaObject } from "../../types";
import { _JTDTypeError } from "./error";
export declare type JTDValuesError = _JTDTypeError<"values", "object", SchemaObject>;
export type JTDValuesError = _JTDTypeError<"values", "object", SchemaObject>;
declare const def: CodeKeywordDefinition;
export default def;

@@ -15,10 +15,13 @@ "use strict";

const { gen, data, schema, it } = cxt;
if ((0, util_1.alwaysValidSchema)(it, schema))
return;
const [valid, cond] = (0, nullable_1.checkNullableObject)(cxt, data);
gen.if(cond);
gen.assign(valid, validateMap());
gen.elseIf((0, codegen_1.not)(valid));
cxt.error();
gen.endIf();
if ((0, util_1.alwaysValidSchema)(it, schema)) {
gen.if((0, codegen_1.not)((0, codegen_1.or)(cond, valid)), () => cxt.error());
}
else {
gen.if(cond);
gen.assign(valid, validateMap());
gen.elseIf((0, codegen_1.not)(valid));
cxt.error();
gen.endIf();
}
cxt.ok(valid);

@@ -25,0 +28,0 @@ function validateMap() {

import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types";
export declare type UnevaluatedItemsError = ErrorObject<"unevaluatedItems", {
export type UnevaluatedItemsError = ErrorObject<"unevaluatedItems", {
limit: number;

@@ -4,0 +4,0 @@ }, AnySchema>;

import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types";
export declare type UnevaluatedPropertiesError = ErrorObject<"unevaluatedProperties", {
export type UnevaluatedPropertiesError = ErrorObject<"unevaluatedProperties", {
unevaluatedProperty: string;

@@ -4,0 +4,0 @@ }, AnySchema>;

import type { CodeKeywordDefinition, ErrorObject } from "../../types";
export declare type ConstError = ErrorObject<"const", {
export type ConstError = ErrorObject<"const", {
allowedValue: any;

@@ -4,0 +4,0 @@ }>;

import type { CodeKeywordDefinition, ErrorObject } from "../../types";
import { DependenciesErrorParams, PropertyDependencies } from "../applicator/dependencies";
export declare type DependentRequiredError = ErrorObject<"dependentRequired", DependenciesErrorParams, PropertyDependencies>;
export type DependentRequiredError = ErrorObject<"dependentRequired", DependenciesErrorParams, PropertyDependencies>;
declare const def: CodeKeywordDefinition;
export default def;
import type { CodeKeywordDefinition, ErrorObject } from "../../types";
export declare type EnumError = ErrorObject<"enum", {
export type EnumError = ErrorObject<"enum", {
allowedValues: any[];

@@ -4,0 +4,0 @@ }, any[] | {

@@ -11,3 +11,3 @@ import type { ErrorObject, Vocabulary } from "../../types";

export default validation;
declare type LimitError = ErrorObject<"maxItems" | "minItems" | "minProperties" | "maxProperties" | "minLength" | "maxLength", {
type LimitError = ErrorObject<"maxItems" | "minItems" | "minProperties" | "maxProperties" | "minLength" | "maxLength", {
limit: number;

@@ -17,2 +17,2 @@ }, number | {

}>;
export declare type ValidationKeywordError = LimitError | LimitNumberError | MultipleOfError | PatternError | RequiredError | UniqueItemsError | ConstError | EnumError;
export type ValidationKeywordError = LimitError | LimitNumberError | MultipleOfError | PatternError | RequiredError | UniqueItemsError | ConstError | EnumError;
import type { CodeKeywordDefinition, ErrorObject } from "../../types";
declare type Kwd = "maximum" | "minimum" | "exclusiveMaximum" | "exclusiveMinimum";
declare type Comparison = "<=" | ">=" | "<" | ">";
export declare type LimitNumberError = ErrorObject<Kwd, {
type Kwd = "maximum" | "minimum" | "exclusiveMaximum" | "exclusiveMinimum";
type Comparison = "<=" | ">=" | "<" | ">";
export type LimitNumberError = ErrorObject<Kwd, {
limit: number;

@@ -6,0 +6,0 @@ comparison: Comparison;

import type { CodeKeywordDefinition, ErrorObject } from "../../types";
export declare type MultipleOfError = ErrorObject<"multipleOf", {
export type MultipleOfError = ErrorObject<"multipleOf", {
multipleOf: number;

@@ -4,0 +4,0 @@ }, number | {

import type { CodeKeywordDefinition, ErrorObject } from "../../types";
export declare type PatternError = ErrorObject<"pattern", {
export type PatternError = ErrorObject<"pattern", {
pattern: string;

@@ -4,0 +4,0 @@ }, string | {

import type { CodeKeywordDefinition, ErrorObject } from "../../types";
export declare type RequiredError = ErrorObject<"required", {
export type RequiredError = ErrorObject<"required", {
missingProperty: string;

@@ -4,0 +4,0 @@ }, string[] | {

import type { CodeKeywordDefinition, ErrorObject } from "../../types";
export declare type UniqueItemsError = ErrorObject<"uniqueItems", {
export type UniqueItemsError = ErrorObject<"uniqueItems", {
i: number;

@@ -4,0 +4,0 @@ j: number;

@@ -120,3 +120,3 @@ import type Ajv from "../../core"

function serializeKeyValue(cxt: SerializeCxt, key: Name, schema: SchemaObject, first: Name): void {
function serializeKeyValue(cxt: SerializeCxt, key: Name, schema: SchemaObject, first?: Name): void {
const {gen, data} = cxt

@@ -160,16 +160,20 @@ addComma(cxt, first)

let first = !discriminator
let firstProp: Name | undefined
for (const key of props) {
if (first) first = false
else gen.add(N.json, str`,`)
serializeProperty(key, properties[key], keyValue(key))
}
if (first) firstProp = gen.let("first", true)
for (const key of optProps) {
const value = keyValue(key)
gen.if(and(_`${value} !== undefined`, isOwnProperty(gen, data, key)), () =>
gen.if(and(_`${value} !== undefined`, isOwnProperty(gen, data, key)), () => {
addComma(cxt, firstProp)
serializeProperty(key, optionalProperties[key], value)
)
})
}
if (schema.additionalProperties) {
gen.forIn("key", data, (key) =>
gen.if(isAdditional(key, allProps), () =>
serializeKeyValue(cxt, key, {}, gen.let("first", first))
)
gen.if(isAdditional(key, allProps), () => serializeKeyValue(cxt, key, {}, firstProp))
)

@@ -195,4 +199,2 @@ }

function serializeProperty(key: string, propSchema: SchemaObject, value: Name): void {
if (first) first = false
else gen.add(N.json, str`,`)
gen.add(N.json, str`${JSON.stringify(key)}:`)

@@ -257,8 +259,12 @@ serializeCode({...cxt, schema: propSchema, data: value})

function addComma({gen}: SerializeCxt, first: Name): void {
gen.if(
first,
() => gen.assign(first, false),
() => gen.add(N.json, str`,`)
)
function addComma({gen}: SerializeCxt, first?: Name): void {
if (first) {
gen.if(
first,
() => gen.assign(first, false),
() => gen.add(N.json, str`,`)
)
} else {
gen.add(N.json, str`,`)
}
}

@@ -289,3 +289,3 @@ import type {

})
it.dataTypes = it.dataTypes.filter((t) => includesType(types, t))
narrowSchemaTypes(it, types)
}

@@ -320,2 +320,11 @@

function narrowSchemaTypes(it: SchemaObjCxt, withTypes: JSONType[]): void {
const ts: JSONType[] = []
for (const t of it.dataTypes) {
if (includesType(withTypes, t)) ts.push(t)
else if (withTypes.includes("integer") && t === "number") ts.push("integer")
}
it.dataTypes = ts
}
function strictTypesError(it: SchemaObjCxt, msg: string): void {

@@ -322,0 +331,0 @@ const schemaPath = it.schemaEnv.baseId + it.errSchemaPath

@@ -77,3 +77,3 @@ /** numeric strings */

/** true if type is a union of string literals */
type IsEnum<T> = null extends EnumString<Exclude<T, null>> ? false : true
type IsEnum<T> = null extends EnumString<T> ? false : true

@@ -92,9 +92,14 @@ /** true only if all types are array types (not tuples) */

/** true if the the type is a values type */
type IsValues<T> = false extends IsUnion<Exclude<T, null>>
? TypeEquality<keyof Exclude<T, null>, string>
type IsValues<T> = false extends IsUnion<T> ? TypeEquality<keyof T, string> : false
/** true if type is a properties type and Union is false, or type is a discriminator type and Union is true */
type IsRecord<T, Union extends boolean> = Union extends IsUnion<T>
? null extends EnumString<keyof T>
? false
: true
: false
/** true if type is a proeprties type and Union is false, or type is a discriminator type and Union is true */
type IsRecord<T, Union extends boolean> = Union extends IsUnion<Exclude<T, null>>
? null extends EnumString<keyof Exclude<T, null>>
/** true if type represents an empty record */
type IsEmptyRecord<T> = [T] extends [Record<string, never>]
? [T] extends [never]
? false

@@ -136,3 +141,3 @@ : true

// TODO we can't actually check that everything in the union was specified
true extends IsEnum<T>
true extends IsEnum<Exclude<T, null>>
? {enum: EnumString<Exclude<T, null>>[]}

@@ -146,4 +151,9 @@ : // arrays - only accepts arrays, could be array of unions to be resolved later

: never
: // empty properties
true extends IsEmptyRecord<Exclude<T, null>>
?
| {properties: Record<string, never>; optionalProperties?: Record<string, never>}
| {optionalProperties: Record<string, never>}
: // values
true extends IsValues<T>
true extends IsValues<Exclude<T, null>>
? T extends Record<string, infer V>

@@ -155,3 +165,3 @@ ? {

: // properties
true extends IsRecord<T, false>
true extends IsRecord<Exclude<T, null>, false>
? ([RequiredKeys<Exclude<T, null>>] extends [never]

@@ -176,3 +186,3 @@ ? {

: // discriminator
true extends IsRecord<T, true>
true extends IsRecord<Exclude<T, null>, true>
? {

@@ -185,3 +195,3 @@ [K in keyof Exclude<T, null>]-?: Exclude<T, null>[K] extends string

[M in Exclude<T, null>[K]]: JTDSchemaType<
Omit<T extends {[C in K]: M} ? T : never, K>,
Omit<T extends Record<K, M> ? T : never, K>,
D

@@ -188,0 +198,0 @@ >

@@ -141,5 +141,3 @@ import type {

gen.forIn("key", data, (key: Name) => {
const _allProps =
it.jtdDiscriminator === undefined ? allProps : [it.jtdDiscriminator].concat(allProps)
const addProp = isAdditional(key, _allProps, "properties")
const addProp = isAdditional(key, allProps, "properties", it.jtdDiscriminator)
const addOptProp = isAdditional(key, allOptProps, "optionalProperties")

@@ -163,3 +161,8 @@ const extra =

function isAdditional(key: Name, props: string[], keyword: string): Code | true {
function isAdditional(
key: Name,
props: string[],
keyword: string,
jtdDiscriminator?: string
): Code | true {
let additional: Code | boolean

@@ -170,4 +173,8 @@ if (props.length > 8) {

additional = not(isOwnProperty(gen, propsSchema as Code, key))
} else if (props.length) {
additional = and(...props.map((p) => _`${key} !== ${p}`))
if (jtdDiscriminator !== undefined) {
additional = and(additional, _`${key} !== ${jtdDiscriminator}`)
}
} else if (props.length || jtdDiscriminator !== undefined) {
const ps = jtdDiscriminator === undefined ? props : [jtdDiscriminator].concat(props)
additional = and(...ps.map((p) => _`${key} !== ${p}`))
} else {

@@ -174,0 +181,0 @@ additional = true

import type {CodeKeywordDefinition, SchemaObject} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {alwaysValidSchema, Type} from "../../compile/util"
import {not, Name} from "../../compile/codegen"
import {not, or, Name} from "../../compile/codegen"
import {checkMetadata} from "./metadata"

@@ -18,9 +18,12 @@ import {checkNullableObject} from "./nullable"

const {gen, data, schema, it} = cxt
if (alwaysValidSchema(it, schema)) return
const [valid, cond] = checkNullableObject(cxt, data)
gen.if(cond)
gen.assign(valid, validateMap())
gen.elseIf(not(valid))
cxt.error()
gen.endIf()
if (alwaysValidSchema(it, schema)) {
gen.if(not(or(cond, valid)), () => cxt.error())
} else {
gen.if(cond)
gen.assign(valid, validateMap())
gen.elseIf(not(valid))
cxt.error()
gen.endIf()
}
cxt.ok(valid)

@@ -27,0 +30,0 @@

{
"name": "ajv",
"version": "8.11.2",
"version": "8.12.0",
"description": "Another JSON Schema Validator",

@@ -68,8 +68,8 @@ "main": "dist/ajv.js",

"@ajv-validator/config": "^0.3.0",
"@rollup/plugin-commonjs": "^23.0.2",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-commonjs": "^24.0.0",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-typescript": "^8.2.1",
"@rollup/plugin-typescript": "^10.0.1",
"@types/chai": "^4.2.12",
"@types/mocha": "^9.0.0",
"@types/mocha": "^10.0.0",
"@types/node": "^18.11.9",

@@ -76,0 +76,0 @@ "@types/require-from-string": "^1.2.0",

@@ -15,3 +15,3 @@ <img align="right" alt="Ajv logo" width="160" src="https://ajv.js.org/img/ajv.svg">

[![Coverage Status](https://coveralls.io/repos/github/ajv-validator/ajv/badge.svg?branch=master)](https://coveralls.io/github/ajv-validator/ajv?branch=master)
[![SimpleX](https://img.shields.io/badge/chat-on%20SimpleX-%2307b4b9)](https://simplex.chat/contact#/?v=1&smp=smp%3A%2F%2Fu2dS9sG8nMNURyZwqASV4yROM28Er0luVTx5X1CsMrU%3D%40smp4.simplex.im%2Fap4lMFzfXF8Hzmh-Vz0WNxp_1jKiOa-h%23MCowBQYDK2VuAyEAcdefddRvDfI8iAuBpztm_J3qFucj8MDZoVs_2EcMTzU%3D)
[![SimpleX](https://img.shields.io/badge/chat-on%20SimpleX-%2307b4b9)](https://simplex.chat/contact#/?v=1-2&smp=smp%3A%2F%2Fu2dS9sG8nMNURyZwqASV4yROM28Er0luVTx5X1CsMrU%3D%40smp4.simplex.im%2FV-6t4hoy_SsvKMi9KekdGX-VKQOhDeAe%23%2F%3Fv%3D1-2%26dh%3DMCowBQYDK2VuAyEAm98gjwvrAEiiz_YgBoaQB9dtKTl5Om1pborUyevQwzg%253D%26srv%3Do5vmywmrnaxalvz6wi3zicyftgio6psuvyniis6gco6bp6ekl4cqj4id.onion&data=%7B%22type%22%3A%22group%22%2C%22groupLinkId%22%3A%22wYrTFafovkymjUtc2vUjCQ%3D%3D%22%7D)
[![Gitter](https://img.shields.io/gitter/room/ajv-validator/ajv.svg)](https://gitter.im/ajv-validator/ajv)

@@ -39,2 +39,3 @@ [![GitHub Sponsors](https://img.shields.io/badge/$-sponsors-brightgreen)](https://github.com/sponsors/epoberezkin)

Some useful site links:
- [Getting started](https://ajv.js.org/guide/getting-started.html)

@@ -105,3 +106,3 @@ - [JSON Schema vs JSON Type Definition](https://ajv.js.org/guide/schema-language.html)

[![performance](https://chart.googleapis.com/chart?chxt=x,y&cht=bhs&chco=76A4FB&chls=2.0&chbh=62,4,1&chs=600x416&chxl=-1:|ajv|@exodus&#x2F;schemasafe|is-my-json-valid|djv|@cfworker&#x2F;json-schema|jsonschema&chd=t:100,69.2,51.5,13.1,5.1,1.2)](https://github.com/ebdrup/json-schema-benchmark/blob/master/README.md#performance)
[![performance](https://chart.googleapis.com/chart?chxt=x,y&cht=bhs&chco=76A4FB&chls=2.0&chbh=62,4,1&chs=600x416&chxl=-1:|ajv|@exodus/schemasafe|is-my-json-valid|djv|@cfworker/json-schema|jsonschema/=t:100,69.2,51.5,13.1,5.1,1.2)](https://github.com/ebdrup/json-schema-benchmark/blob/master/README.md#performance)

@@ -163,3 +164,3 @@ ## Features

foo: {type: "integer"},
bar: {type: "string"}
bar: {type: "string"},
},

@@ -172,3 +173,3 @@ required: ["foo"],

foo: 1,
bar: "abc"
bar: "abc",
}

@@ -175,0 +176,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc