@apidevtools/json-schema-ref-parser 14.1.0 → 14.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/bundle.js +6 -2
- package/lib/bundle.ts +6 -2
- package/package.json +1 -1
package/dist/lib/bundle.js
CHANGED
|
@@ -104,8 +104,12 @@ function crawl(parent, key, path, pathFromRoot, indirections, inventory, $refs,
|
|
|
104
104
|
else {
|
|
105
105
|
crawl(obj, key, keyPath, keyPathFromRoot, indirections, inventory, $refs, options);
|
|
106
106
|
}
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
// We need to ensure that we have an object to work with here because we may be crawling
|
|
108
|
+
// an `examples` schema and `value` may be nullish.
|
|
109
|
+
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
110
|
+
if ("$ref" in value) {
|
|
111
|
+
bundleOptions?.onBundle?.(value["$ref"], obj[key], obj, key);
|
|
112
|
+
}
|
|
109
113
|
}
|
|
110
114
|
}
|
|
111
115
|
}
|
package/lib/bundle.ts
CHANGED
|
@@ -101,8 +101,12 @@ function crawl<S extends object = JSONSchema, O extends ParserOptions<S> = Parse
|
|
|
101
101
|
crawl(obj, key, keyPath, keyPathFromRoot, indirections, inventory, $refs, options);
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
// We need to ensure that we have an object to work with here because we may be crawling
|
|
105
|
+
// an `examples` schema and `value` may be nullish.
|
|
106
|
+
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
107
|
+
if ("$ref" in value) {
|
|
108
|
+
bundleOptions?.onBundle?.(value["$ref"], obj[key], obj as any, key);
|
|
109
|
+
}
|
|
106
110
|
}
|
|
107
111
|
}
|
|
108
112
|
}
|