|
|
@ -683,16 +683,15 @@ function matchQueryPart (obj, queryKey, queryValue, treatObjAsValue) { |
|
|
|
|
|
|
|
|
|
|
|
// Check if the object value is an array
|
|
|
|
// Check if the object value is an array
|
|
|
|
if (util.isArray(objValue) && !treatObjAsValue) { |
|
|
|
if (util.isArray(objValue) && !treatObjAsValue) { |
|
|
|
// Check if we are applying a comparison function to the array itself
|
|
|
|
// Check if we are using an array-specific comparison function
|
|
|
|
if (queryValue !== null && typeof queryValue === 'object' && !util.isRegExp(queryValue)) { |
|
|
|
if (queryValue !== null && typeof queryValue === 'object' && !util.isRegExp(queryValue)) { |
|
|
|
keys = Object.keys(queryValue);
|
|
|
|
keys = Object.keys(queryValue);
|
|
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < keys.length; i += 1) { |
|
|
|
for (i = 0; i < keys.length; i += 1) { |
|
|
|
if (arrayComparisonFunctions[keys[i]]) { return matchQueryPart(obj, queryKey, queryValue, true); } |
|
|
|
if (arrayComparisonFunctions[keys[i]]) { return matchQueryPart(obj, queryKey, queryValue, true); } |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Else, treat it as an array of { obj, query } where there needs to be at least one match
|
|
|
|
// If not, treat it as an array of { obj, query } where there needs to be at least one match
|
|
|
|
for (i = 0; i < objValue.length; i += 1) { |
|
|
|
for (i = 0; i < objValue.length; i += 1) { |
|
|
|
if (matchQueryPart({ k: objValue[i] }, 'k', queryValue)) { return true; } // k here could be any string
|
|
|
|
if (matchQueryPart({ k: objValue[i] }, 'k', queryValue)) { return true; } // k here could be any string
|
|
|
|
} |
|
|
|
} |
|
|
|