Skip to content

Commit

Permalink
use faster check
Browse files Browse the repository at this point in the history
  • Loading branch information
icebob committed Dec 6, 2022
1 parent 240cf04 commit 38783bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rules/array.js
Expand Up @@ -10,7 +10,7 @@ module.exports = function ({ schema, messages }, path, context) {
sanitized = true;
// Convert to array if not and the value is not null or undefined
src.push(`
if (!Array.isArray(value) && [null, undefined].indexOf(value) === -1) {
if (!Array.isArray(value) && value != null) {
value = [value];
}
`);
Expand Down

0 comments on commit 38783bc

Please sign in to comment.