Fix types.js

Fix fatal error at types.js
This commit is contained in:
Nikiroy78 2023-05-28 22:51:19 +03:00 committed by GitHub
parent 1fe6295af0
commit a773ca5b7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -88,7 +88,7 @@ const types = {
return [false, undefined];
}
// checking type of array
let isSyntax = Object.assign({}, value).filter(item => type.syntax(item, needs_convert)[0]).length == value.length;
let isSyntax = [].concat(value).filter(item => type.syntax(item, needs_convert)[0]).length == value.length;
return [isSyntax, isSyntax ? value : undefined]
}
}),
@ -214,4 +214,4 @@ const types = {
};
module.exports = types;
module.exports = types;