Skip to content

Commit 7ad6e30

Browse files
committed
Relax bookmark value checking to ignore null and undefined values
1 parent bcba897 commit 7ad6e30

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/v1/internal/bookmark.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,13 @@ function asStringArray(value) {
9090
const result = [];
9191
for (let i = 0; i < value.length; i++) {
9292
const element = value[i];
93-
if (!util.isString(element)) {
94-
throw new TypeError(`Bookmark should be a string, given: '${element}'`);
93+
// if it is undefined or null, ignore it
94+
if (element !== undefined && element !== null) {
95+
if (!util.isString(element)) {
96+
throw new TypeError(`Bookmark should be a string, given: '${element}'`);
97+
}
98+
result.push(element);
9599
}
96-
result.push(element);
97100
}
98101
return result;
99102
}

0 commit comments

Comments
 (0)