New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

json-schema-walker

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-schema-walker - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

4

dist/cjs/index.d.ts

@@ -6,3 +6,3 @@ import type { JSONSchema } from "@apidevtools/json-schema-ref-parser";

declare type IVocabulary = Record<string, any>;
interface Options<T extends InputSchema> {
interface Options {
cloneSchema?: boolean;

@@ -18,3 +18,3 @@ dereference?: boolean;

constructor();
loadSchema: (schema: T, options?: Options<T>) => Promise<void>;
loadSchema: (schema: T, options?: Options) => Promise<void>;
walk: (processor: ProcessorFunction<T>, vocabulary: IVocabulary) => Promise<void>;

@@ -21,0 +21,0 @@ private cleanupVisited;

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

for (const entry of Object.values(schema)) {
if (typeof entry === "object" && null !== entry && entry[visited]) {
if (entry && typeof entry === "object" && entry[visited]) {
delete entry[visited];

@@ -103,3 +103,3 @@ this.cleanupVisited(entry);

this.processSchemaKey = (schema, keyword) => {
if (typeof schema[keyword] !== "object") {
if (!schema[keyword] || typeof schema[keyword] !== "object") {
return;

@@ -116,3 +116,4 @@ }

for (const prop of Object.getOwnPropertyNames(schema[keyword])) {
if (typeof schema[keyword][prop] === "object") {
const schemaElem = schema[keyword][prop];
if (typeof schemaElem === "object" && schemaElem) {
this.applyUserProcessor(schema[keyword], prop);

@@ -124,3 +125,4 @@ }

for (const prop of Object.getOwnPropertyNames(schema[keyword])) {
if (typeof schema[keyword][prop] === "object") {
const schemaElem = schema[keyword][prop];
if (schemaElem && typeof schemaElem === "object") {
this.applyUserProcessor(schema[keyword], prop);

@@ -127,0 +129,0 @@ }

@@ -6,3 +6,3 @@ import type { JSONSchema } from "@apidevtools/json-schema-ref-parser";

declare type IVocabulary = Record<string, any>;
interface Options<T extends InputSchema> {
interface Options {
cloneSchema?: boolean;

@@ -18,3 +18,3 @@ dereference?: boolean;

constructor();
loadSchema: (schema: T, options?: Options<T>) => Promise<void>;
loadSchema: (schema: T, options?: Options) => Promise<void>;
walk: (processor: ProcessorFunction<T>, vocabulary: IVocabulary) => Promise<void>;

@@ -21,0 +21,0 @@ private cleanupVisited;

@@ -57,3 +57,3 @@ import clone from "clone";

for (const entry of Object.values(schema)) {
if (typeof entry === "object" && null !== entry && entry[visited]) {
if (entry && typeof entry === "object" && entry[visited]) {
delete entry[visited];

@@ -88,3 +88,3 @@ this.cleanupVisited(entry);

this.processSchemaKey = (schema, keyword) => {
if (typeof schema[keyword] !== "object") {
if (!schema[keyword] || typeof schema[keyword] !== "object") {
return;

@@ -101,3 +101,4 @@ }

for (const prop of Object.getOwnPropertyNames(schema[keyword])) {
if (typeof schema[keyword][prop] === "object") {
const schemaElem = schema[keyword][prop];
if (typeof schemaElem === "object" && schemaElem) {
this.applyUserProcessor(schema[keyword], prop);

@@ -109,3 +110,4 @@ }

for (const prop of Object.getOwnPropertyNames(schema[keyword])) {
if (typeof schema[keyword][prop] === "object") {
const schemaElem = schema[keyword][prop];
if (schemaElem && typeof schemaElem === "object") {
this.applyUserProcessor(schema[keyword], prop);

@@ -112,0 +114,0 @@ }

{
"name": "json-schema-walker",
"version": "1.0.0",
"version": "1.1.0",
"description": "A system that visits all schema objects in a JSON Schema document and makes callbacks before visiting all of the current schema object's subschemas.",

@@ -5,0 +5,0 @@ "types": "dist/mjs/index.d.ts",

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc