Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

json-schema-ref-parser

Package Overview
Dependencies
Maintainers
1
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-schema-ref-parser - npm Package Compare versions

Comparing version 7.1.3 to 7.1.4

0

lib/dereference.js

@@ -0,0 +0,0 @@ "use strict";

12

lib/index.d.ts

@@ -209,2 +209,4 @@ import { JSONSchema4, JSONSchema4Type, JSONSchema6, JSONSchema6Type } from 'json-schema';

http?: HTTPResolverOptions | boolean
} & {
[key: string]: Partial<ResolverOptions>
}

@@ -303,2 +305,12 @@

canParse?: boolean | RegExp | string | string[] | ((file: FileInfo) => boolean)
/**
* This is where the real work of a parser happens. The `parse` method accepts the same [file info object](file-info-object.md) as the `canParse` function, but rather than returning a boolean value, the `parse` method should return a JavaScript representation of the file contents. For our CSV parser, that is a two-dimensional array of lines and values. For your parser, it might be an object, a string, a custom class, or anything else.
*
* Unlike the `canParse` function, the `parse` method can also be asynchronous. This might be important if your parser needs to retrieve data from a database or if it relies on an external HTTP service to return the parsed value. You can return your asynchronous value via a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) or a Node.js-style error-first callback. Here are examples of both approaches:
*/
parse(
file: FileInfo,
callback?: (error: Error | null, data: string | null) => any
): unknown | Promise<unknown>
}

@@ -305,0 +317,0 @@

@@ -0,0 +0,0 @@ "use strict";

@@ -32,3 +32,15 @@ "use strict";

exports.cwd = function cwd () {
return process.browser ? location.href : process.cwd() + "/";
if (process.browser) {
return location.href;
}
let path = process.cwd();
let lastChar = path.slice(-1);
if (lastChar === "/" || lastChar === "\\") {
return path;
}
else {
return path + "/";
}
};

@@ -35,0 +47,0 @@

2

package.json
{
"name": "json-schema-ref-parser",
"version": "7.1.3",
"version": "7.1.4",
"description": "Parse, Resolve, and Dereference JSON Schema $ref pointers",

@@ -5,0 +5,0 @@ "keywords": [

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