Skip to content

Commit

Permalink
Fixing how multiple inputs for a non-array attribute is queried
Browse files Browse the repository at this point in the history
  • Loading branch information
avoidwork committed Sep 16, 2020
1 parent 9030311 commit 8d3554c
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions lib/haro.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @author Jason Mulligan <jason.mulligan@avoidwork.com>
* @copyright 2020
* @license BSD-3-Clause
* @version 9.0.0
* @version 9.0.1
*/
"use strict";

Expand Down Expand Up @@ -453,7 +453,7 @@
let result;
if (Array.isArray(predicate[i])) {
result = `Array.isArray(a['${i}']) ? ${predicate[i].map(arg => `a['${i}'].includes(${typeof arg === "string" ? `'${arg}'` : arg})`).join(` ${op} `)} : a['${i}'] === '${predicate[i].join(",")}'`;
result = `Array.isArray(a['${i}']) ? ${predicate[i].map(arg => `a['${i}'].includes(${typeof arg === "string" ? `'${arg}'` : arg})`).join(` ${op} `)} : (${predicate[i].map(arg => `a['${i}'] === ${typeof arg === "string" ? `'${arg}'` : arg}`).join(` ${op} `)})`;
} else if (predicate[i] instanceof RegExp) {
result = `Array.isArray(a['${i}']) ? a['${i}'].filter(i => ${predicate[i]}.test(a['${i}'])).length > 0 : ${predicate[i]}.test(a['${i}'])`;
} else {
Expand All @@ -477,7 +477,7 @@
return obj;
}

factory.version = "9.0.0";
factory.version = "9.0.1";

// Node, AMD & window supported
if (typeof exports !== "undefined") {
Expand Down
4 changes: 2 additions & 2 deletions lib/haro.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8d3554c

Please sign in to comment.