hoek
Advanced tools
Comparing version 6.0.1 to 6.0.2
@@ -375,6 +375,13 @@ 'use strict'; | ||
else if (Array.isArray(ref)) { | ||
const onlyOnce = !!(options.only && options.once); | ||
if (onlyOnce && ref.length !== values.length) { | ||
return false; | ||
} | ||
for (let i = 0; i < ref.length; ++i) { | ||
let matched = false; | ||
for (let j = 0; j < values.length && matched === false; ++j) { | ||
matched = compare(values[j], ref[i], compareFlags) && j; | ||
if (!onlyOnce || matches[j] === 0) { | ||
matched = compare(values[j], ref[i], compareFlags) && j; | ||
} | ||
} | ||
@@ -410,2 +417,8 @@ | ||
if (options.only) { | ||
if (misses || !options.once) { | ||
return !misses; | ||
} | ||
} | ||
let result = false; | ||
@@ -421,8 +434,2 @@ for (let i = 0; i < matches.length; ++i) { | ||
if (options.only && | ||
misses) { | ||
return false; | ||
} | ||
return result; | ||
@@ -429,0 +436,0 @@ }; |
{ | ||
"name": "hoek", | ||
"description": "General purpose node utilities", | ||
"version": "6.0.1", | ||
"version": "6.0.2", | ||
"repository": "git://github.com/hapijs/hoek", | ||
@@ -6,0 +6,0 @@ "main": "lib/index.js", |
29235
768