@stoplight/json-ref-resolver
Advanced tools
Comparing version 3.1.1 to 3.1.2
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
82327
27
936