You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@stoplight/json-ref-resolver

Package Overview
Dependencies
Maintainers
22
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stoplight/json-ref-resolver - npm Package Compare versions

Comparing version

to
3.1.2

uri.d.ts

4

crawler.js

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

});
if (ref) {
if (ref !== undefined) {
this._resolveRef({

@@ -46,3 +46,3 @@ ref,

parentPath.push(key);
if (ref) {
if (ref !== undefined) {
this._resolveRef({

@@ -49,0 +49,0 @@ ref,

{
"name": "@stoplight/json-ref-resolver",
"version": "3.1.1",
"version": "3.1.2",
"description": "Recursively resolve JSON pointers and remote authorities.",

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

@@ -11,2 +11,3 @@ "use strict";

const URI = require("urijs");
const uri_1 = require("./uri");
const cache_1 = require("./cache");

@@ -27,5 +28,5 @@ const crawler_1 = require("./crawler");

const refStr = this.getRef(opts.key, opts.val);
if (!refStr)
if (refStr === undefined)
return;
let ref = new URI(refStr);
let ref = new uri_1.ExtendedURI(refStr);
if (refStr[0] !== '#') {

@@ -32,0 +33,0 @@ const isFile = this.isFile(ref);

import * as URI from 'urijs';
import { ExtendedURI } from './uri';
export declare const addToJSONPointer: (pointer: string, part: string) => string;
export declare const uriToJSONPointer: (uri: URI) => string;
export declare const uriIsJSONPointer: (ref: URI) => boolean;
export declare const uriToJSONPointer: (uri: URI | ExtendedURI) => string;
export declare const uriIsJSONPointer: (ref: URI | ExtendedURI) => boolean;

@@ -27,7 +27,10 @@ "use strict";

exports.uriToJSONPointer = (uri) => {
if ('length' in uri && uri.length === 0) {
return '';
}
return uri.fragment() !== '' ? `#${uri.fragment()}` : uri.href() === '' ? '#' : '';
};
exports.uriIsJSONPointer = (ref) => {
return ref.path() === '';
return (!('length' in ref) || ref.length > 0) && ref.path() === '';
};
//# sourceMappingURL=utils.js.map

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