json-schema-ref-parser
Advanced tools
Comparing version 1.0.0-alpha.17 to 1.0.0-alpha.18
/**! | ||
* JSON Schema $Ref Parser v1.0.0-alpha.17 | ||
* JSON Schema $Ref Parser v1.0.0-alpha.18 | ||
* | ||
@@ -4,0 +4,0 @@ * @link https://github.com/BigstickCarpet/json-schema-ref-parser |
@@ -105,4 +105,5 @@ 'use strict'; | ||
return new Promise(function(resolve, reject) { | ||
var file; | ||
try { | ||
var file = decodeURI($ref.path); | ||
file = decodeURI($ref.path); | ||
} | ||
@@ -109,0 +110,0 @@ catch (err) { |
@@ -33,10 +33,13 @@ 'use strict'; | ||
var keys = Object.keys($refs); | ||
types = _flatten(arguments); | ||
types = _flatten(arguments); | ||
if (types.length === 0) { | ||
return keys; | ||
if (types.length > 0) { | ||
keys = keys.filter(function(key) { | ||
return types.indexOf($refs[key].type) !== -1; | ||
}); | ||
} | ||
return keys.filter(function(key) { | ||
return types.indexOf($refs[key].type) !== -1; | ||
return keys.map(function(key) { | ||
// Decode URL-encoded characters for local file paths | ||
return $refs[key].type === 'fs' ? decodeURI(key) : key; | ||
}); | ||
@@ -53,9 +56,6 @@ }; | ||
var $refs = this._$refs; | ||
var keys = Object.keys($refs); | ||
types = _flatten(arguments); | ||
var keys = this.paths(types); | ||
return keys.reduce(function(obj, key) { | ||
if (types.length === 0 || types.indexOf($refs[key].type) !== -1) { | ||
obj[key] = $refs[key].value; | ||
} | ||
obj[key] = $refs[key].value; | ||
}, {}); | ||
@@ -62,0 +62,0 @@ }; |
@@ -21,3 +21,3 @@ 'use strict'; | ||
return process.browser ? location.href : process.cwd() + '/'; | ||
} | ||
}; | ||
@@ -32,3 +32,3 @@ /** | ||
return protocolPattern.test(path); | ||
} | ||
}; | ||
@@ -47,3 +47,3 @@ /** | ||
return ''; | ||
} | ||
}; | ||
@@ -62,3 +62,3 @@ /** | ||
return path; | ||
} | ||
}; | ||
@@ -77,3 +77,3 @@ /** | ||
return ''; | ||
} | ||
}; | ||
@@ -103,2 +103,2 @@ /** | ||
} | ||
} | ||
}; |
{ | ||
"name": "json-schema-ref-parser", | ||
"version": "1.0.0-alpha.17", | ||
"version": "1.0.0-alpha.18", | ||
"description": "Parse, Resolve, and Dereference JSON Schema $ref pointers", | ||
@@ -66,3 +66,3 @@ "keywords": [ | ||
"es6-promise": "^3.0.2", | ||
"js-yaml": "^3.4.1", | ||
"js-yaml": "^3.4.2", | ||
"lodash": "^3.10.1", | ||
@@ -69,0 +69,0 @@ "ono": "^1.0.22" |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
2532997
20318
Updatedjs-yaml@^3.4.2