@apidevtools/json-schema-ref-parser
Advanced tools
@@ -60,3 +60,6 @@ "use strict"; | ||
| circular = dereferenced.circular; | ||
| obj[key] = dereferenced.value; | ||
| // Avoid pointless mutations; breaks frozen objects to no profit | ||
| if (obj[key] !== dereferenced.value) { | ||
| obj[key] = dereferenced.value; | ||
| } | ||
| } | ||
@@ -67,3 +70,6 @@ else { | ||
| circular = dereferenced.circular; | ||
| obj[key] = dereferenced.value; | ||
| // Avoid pointless mutations; breaks frozen objects to no profit | ||
| if (obj[key] !== dereferenced.value) { | ||
| obj[key] = dereferenced.value; | ||
| } | ||
| } | ||
@@ -70,0 +76,0 @@ else { |
+11
-3
@@ -67,2 +67,3 @@ "use strict"; | ||
| * @param {$RefParserOptions} options | ||
| * @param {string} pathFromRoot - the path of place that initiated resolving | ||
| * | ||
@@ -75,3 +76,3 @@ * @returns {Pointer} | ||
| */ | ||
| Pointer.prototype.resolve = function (obj, options) { | ||
| Pointer.prototype.resolve = function (obj, options, pathFromRoot) { | ||
| let tokens = Pointer.parse(this.path, this.originalPath); | ||
@@ -88,2 +89,6 @@ | ||
| if (typeof this.value === "object" && this.value !== null && "$ref" in this.value) { | ||
| return this; | ||
| } | ||
| let token = tokens[i]; | ||
@@ -100,3 +105,6 @@ if (this.value[token] === undefined || this.value[token] === null) { | ||
| // Resolve the final value | ||
| resolveIf$Ref(this, options); | ||
| if (!this.value || this.value.$ref && url.resolve(this.path, this.value.$ref) !== pathFromRoot) { | ||
| resolveIf$Ref(this, options); | ||
| } | ||
| return this; | ||
@@ -233,3 +241,3 @@ }; | ||
| else { | ||
| let resolved = pointer.$ref.$refs._resolve($refPath, url.getHash(pointer.path), options); | ||
| let resolved = pointer.$ref.$refs._resolve($refPath, pointer.path, options); | ||
| pointer.indirections += resolved.indirections + 1; | ||
@@ -236,0 +244,0 @@ |
+1
-1
@@ -115,3 +115,3 @@ "use strict"; | ||
| try { | ||
| return pointer.resolve(this.value, options); | ||
| return pointer.resolve(this.value, options, pathFromRoot); | ||
| } | ||
@@ -118,0 +118,0 @@ catch (err) { |
+3
-3
| { | ||
| "name": "@apidevtools/json-schema-ref-parser", | ||
| "version": "9.0.5", | ||
| "version": "9.0.6", | ||
| "description": "Parse, Resolve, and Dereference JSON Schema $ref pointers", | ||
@@ -55,3 +55,3 @@ "keywords": [ | ||
| "@babel/polyfill": "^7.10.4", | ||
| "@jsdevtools/eslint-config": "^1.0.5", | ||
| "@jsdevtools/eslint-config": "^1.0.7", | ||
| "@jsdevtools/host-environment": "^2.0.4", | ||
@@ -61,3 +61,3 @@ "@jsdevtools/karma-config": "^3.1.7", | ||
| "@types/json-schema": "^7.0.4", | ||
| "@types/node": "^14.0.23", | ||
| "@types/node": "^14.0.25", | ||
| "chai": "^4.2.0", | ||
@@ -64,0 +64,0 @@ "chai-subset": "^1.6.0", |
+1
-1
@@ -132,3 +132,3 @@ JSON Schema $Ref Parser | ||
| -------------------------- | ||
| I welcome any contributions, enhancements, and bug-fixes. [File an issue](https://github.com/APIDevTools/json-schema-ref-parser/issues) on GitHub and [submit a pull request](https://github.com/APIDevTools/json-schema-ref-parser/pulls). | ||
| I welcome any contributions, enhancements, and bug-fixes. [Open an issue](https://github.com/APIDevTools/json-schema-ref-parser/issues) on GitHub and [submit a pull request](https://github.com/APIDevTools/json-schema-ref-parser/pulls). | ||
@@ -135,0 +135,0 @@ #### Building/Testing |
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
147131
0.41%3070
0.39%