Skip to content

Commit a91146c

Browse files
committed
fix: check for obj
1 parent edbd0a3 commit a91146c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ const validator = (schema: JSONSchema, data: any): true | ValidationErrors => {
124124
traverse(schema, (ss, isCycle, path, parent: JSONSchema) => {
125125
const regularPath = schemaPathToRegularPath(path);
126126
let reffed = data;
127-
if (typeof data === "object") {
127+
if (data instanceof Object) {
128128
const [r] = jsonpath.query(data, regularPath);
129129
reffed = r;
130130
}

0 commit comments

Comments
 (0)