Skip to content

Commit dda2018

Browse files
committed
skip typed arrays and DataViews while crawling the schema
1 parent ba5f4c2 commit dda2018

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

lib/bundle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function bundle (parser, options) {
3939
function crawl (parent, key, path, pathFromRoot, indirections, inventory, $refs, options) {
4040
let obj = key === null ? parent : parent[key];
4141

42-
if (obj && typeof obj === "object") {
42+
if (obj && typeof obj === "object" && !ArrayBuffer.isView(obj)) {
4343
if ($Ref.isAllowed$Ref(obj)) {
4444
inventory$Ref(parent, key, path, pathFromRoot, indirections, inventory, $refs, options);
4545
}

lib/dereference.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function crawl (obj, path, pathFromRoot, parents, $refs, options) {
3939
circular: false
4040
};
4141

42-
if (obj && typeof obj === "object") {
42+
if (obj && typeof obj === "object" && !ArrayBuffer.isView(obj)) {
4343
parents.push(obj);
4444

4545
if ($Ref.isAllowed$Ref(obj, options)) {

lib/resolve-external.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function resolveExternal (parser, options) {
5454
function crawl (obj, path, $refs, options) {
5555
let promises = [];
5656

57-
if (obj && typeof obj === "object") {
57+
if (obj && typeof obj === "object" && !ArrayBuffer.isView(obj)) {
5858
if ($Ref.isExternal$Ref(obj)) {
5959
promises.push(resolve$Ref(obj, path, $refs, options));
6060
}

0 commit comments

Comments
 (0)