Socket
Socket
Sign inDemoInstall

ajv

Package Overview
Dependencies
Maintainers
2
Versions
355
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ajv - npm Package Compare versions

Comparing version 8.16.0 to 8.17.1

1

dist/compile/codegen/code.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.regexpCode = exports.getEsmExportName = exports.getProperty = exports.safeStringify = exports.stringify = exports.strConcat = exports.addCodeArg = exports.str = exports._ = exports.nil = exports._Code = exports.Name = exports.IDENTIFIER = exports._CodeOrName = void 0;
// eslint-disable-next-line @typescript-eslint/no-extraneous-class
class _CodeOrName {

@@ -5,0 +6,0 @@ }

4

dist/compile/resolve.d.ts
import type { AnySchema, AnySchemaObject, UriResolver } from "../types";
import type Ajv from "../ajv";
import type { URIComponents } from "uri-js";
import type { URIComponent } from "fast-uri";
export type LocalRefs = {

@@ -9,5 +9,5 @@ [Ref in string]?: AnySchemaObject;

export declare function getFullPath(resolver: UriResolver, id?: string, normalize?: boolean): string;
export declare function _getFullPath(resolver: UriResolver, p: URIComponents): string;
export declare function _getFullPath(resolver: UriResolver, p: URIComponent): string;
export declare function normalizeId(id: string | undefined): string;
export declare function resolveUrl(resolver: UriResolver, baseId: string, id: string): string;
export declare function getSchemaRefs(this: Ajv, schema: AnySchema, baseId: string): LocalRefs;

@@ -1,2 +0,2 @@

import * as uri from "uri-js";
import * as uri from "fast-uri";
type URI = typeof uri & {

@@ -3,0 +3,0 @@ code: string;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const uri = require("uri-js");
const uri = require("fast-uri");
uri.code = 'require("ajv/dist/runtime/uri").default';
exports.default = uri;
//# sourceMappingURL=uri.js.map

@@ -1,2 +0,2 @@

import * as URI from "uri-js";
import { URIComponent } from "fast-uri";
import type { CodeGen, Code, Name, ScopeValueSets, ValueScopeName } from "../compile/codegen";

@@ -179,6 +179,6 @@ import type { SchemaEnv, SchemaCxt, SchemaObjCxt } from "../compile";

export interface UriResolver {
parse(uri: string): URI.URIComponents;
parse(uri: string): URIComponent;
resolve(base: string, path: string): string;
serialize(component: URI.URIComponents): string;
serialize(component: URIComponent): string;
}
export {};

@@ -66,6 +66,6 @@ type StrictNullChecksWrapper<Name extends string, Type> = undefined extends null ? `strictNullChecks must be true in tsconfig to use ${Name}` : Type;

dependencies?: {
[K in keyof T]?: Readonly<(keyof T)[]> | UncheckedPartialSchema<T>;
[K in keyof T]?: readonly (keyof T)[] | UncheckedPartialSchema<T>;
};
dependentRequired?: {
[K in keyof T]?: Readonly<(keyof T)[]>;
[K in keyof T]?: readonly (keyof T)[];
};

@@ -78,7 +78,7 @@ dependentSchemas?: {

} & (IsPartial extends true ? {
required: Readonly<(keyof T)[]>;
required: readonly (keyof T)[];
} : [UncheckedRequiredMembers<T>] extends [never] ? {
required?: Readonly<UncheckedRequiredMembers<T>[]>;
required?: readonly UncheckedRequiredMembers<T>[];
} : {
required: Readonly<UncheckedRequiredMembers<T>[]>;
required: readonly UncheckedRequiredMembers<T>[];
}) : T extends null ? {

@@ -88,5 +88,5 @@ type: JSONType<"null", IsPartial>;

} : never) & {
allOf?: Readonly<UncheckedPartialSchema<T>[]>;
anyOf?: Readonly<UncheckedPartialSchema<T>[]>;
oneOf?: Readonly<UncheckedPartialSchema<T>[]>;
allOf?: readonly UncheckedPartialSchema<T>[];
anyOf?: readonly UncheckedPartialSchema<T>[];
oneOf?: readonly UncheckedPartialSchema<T>[];
if?: UncheckedPartialSchema<T>;

@@ -120,3 +120,3 @@ then?: UncheckedPartialSchema<T>;

const?: null;
enum?: Readonly<(T | null)[]>;
enum?: readonly (T | null)[];
default?: T | null;

@@ -126,5 +126,5 @@ } : {

const?: T;
enum?: Readonly<T[]>;
enum?: readonly T[];
default?: T;
};
export {};

@@ -0,1 +1,2 @@

// eslint-disable-next-line @typescript-eslint/no-extraneous-class
export abstract class _CodeOrName {

@@ -2,0 +3,0 @@ abstract readonly str: string

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

import {validateFunctionCode} from "./validate"
import * as URI from "uri-js"
import {URIComponent} from "fast-uri"
import {JSONType} from "./rules"

@@ -299,3 +299,3 @@

this: Ajv,
parsedRef: URI.URIComponents,
parsedRef: URIComponent,
{baseId, schema, root}: SchemaEnv

@@ -302,0 +302,0 @@ ): SchemaEnv | undefined {

import type {AnySchema, AnySchemaObject, UriResolver} from "../types"
import type Ajv from "../ajv"
import type {URIComponents} from "uri-js"
import type {URIComponent} from "fast-uri"
import {eachItem} from "./util"

@@ -76,3 +76,3 @@ import * as equal from "fast-deep-equal"

export function _getFullPath(resolver: UriResolver, p: URIComponents): string {
export function _getFullPath(resolver: UriResolver, p: URIComponent): string {
const serialized = resolver.serialize(p)

@@ -79,0 +79,0 @@ return serialized.split("#")[0] + "#"

@@ -1,2 +0,2 @@

import * as uri from "uri-js"
import * as uri from "fast-uri"

@@ -3,0 +3,0 @@ type URI = typeof uri & {code: string}

@@ -1,2 +0,2 @@

import * as URI from "uri-js"
import {URIComponent} from "fast-uri"
import type {CodeGen, Code, Name, ScopeValueSets, ValueScopeName} from "../compile/codegen"

@@ -241,5 +241,5 @@ import type {SchemaEnv, SchemaCxt, SchemaObjCxt} from "../compile"

export interface UriResolver {
parse(uri: string): URI.URIComponents
parse(uri: string): URIComponent
resolve(base: string, path: string): string
serialize(component: URI.URIComponents): string
serialize(component: URIComponent): string
}

@@ -111,4 +111,4 @@ /* eslint-disable @typescript-eslint/no-empty-interface */

propertyNames?: Omit<UncheckedJSONSchemaType<string, false>, "type"> & {type?: "string"}
dependencies?: {[K in keyof T]?: Readonly<(keyof T)[]> | UncheckedPartialSchema<T>}
dependentRequired?: {[K in keyof T]?: Readonly<(keyof T)[]>}
dependencies?: {[K in keyof T]?: readonly (keyof T)[] | UncheckedPartialSchema<T>}
dependentRequired?: {[K in keyof T]?: readonly (keyof T)[]}
dependentSchemas?: {[K in keyof T]?: UncheckedPartialSchema<T>}

@@ -118,6 +118,6 @@ minProperties?: number

} & (IsPartial extends true // "required" is not necessary if it's a non-partial type with no required keys // are listed it only asserts that optional cannot be listed. // "required" type does not guarantee that all required properties
? {required: Readonly<(keyof T)[]>}
? {required: readonly (keyof T)[]}
: [UncheckedRequiredMembers<T>] extends [never]
? {required?: Readonly<UncheckedRequiredMembers<T>[]>}
: {required: Readonly<UncheckedRequiredMembers<T>[]>})
? {required?: readonly UncheckedRequiredMembers<T>[]}
: {required: readonly UncheckedRequiredMembers<T>[]})
: T extends null

@@ -129,5 +129,5 @@ ? {

: never) & {
allOf?: Readonly<UncheckedPartialSchema<T>[]>
anyOf?: Readonly<UncheckedPartialSchema<T>[]>
oneOf?: Readonly<UncheckedPartialSchema<T>[]>
allOf?: readonly UncheckedPartialSchema<T>[]
anyOf?: readonly UncheckedPartialSchema<T>[]
oneOf?: readonly UncheckedPartialSchema<T>[]
if?: UncheckedPartialSchema<T>

@@ -182,3 +182,3 @@ then?: UncheckedPartialSchema<T>

const?: null // any non-null value would fail `const: null`, `null` would fail any other value in const
enum?: Readonly<(T | null)[]> // `null` must be explicitly included in "enum" for `null` to pass
enum?: readonly (T | null)[] // `null` must be explicitly included in "enum" for `null` to pass
default?: T | null

@@ -189,4 +189,4 @@ }

const?: T
enum?: Readonly<T[]>
enum?: readonly T[]
default?: T
}
{
"name": "ajv",
"version": "8.16.0",
"version": "8.17.1",
"description": "Another JSON Schema Validator",

@@ -62,5 +62,5 @@ "main": "dist/ajv.js",

"fast-deep-equal": "^3.1.3",
"fast-uri": "^3.0.1",
"json-schema-traverse": "^1.0.0",
"require-from-string": "^2.0.2",
"uri-js": "^4.4.1"
"require-from-string": "^2.0.2"
},

@@ -87,3 +87,2 @@ "devDependencies": {

"eslint-config-prettier": "^9.1.0",
"fast-uri": "^2.3.0",
"glob": "^10.3.10",

@@ -109,3 +108,4 @@ "husky": "^9.0.11",

"tsify": "^5.0.4",
"typescript": "5.3.3"
"typescript": "5.3.3",
"uri-js": "^4.4.1"
},

@@ -112,0 +112,0 @@ "collective": {

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
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc