diff --git a/src/jsonselect.js b/src/jsonselect.js index 2fbba51..6dd6e6c 100644 --- a/src/jsonselect.js +++ b/src/jsonselect.js @@ -148,7 +148,7 @@ // (4) the 'x' value placeholder "(x)|" + // (5) binops - "(&&|\\|\\||[\\$\\^<>!\\*]=|[=+\\-*/%<>])|" + + "(&&|\\|\\||[\\$\\^<>!\\*\\-]=|[=+\\-*/%<>])|" + // (6) parens "([\\(\\)])" + ")" @@ -166,6 +166,7 @@ '$=': [ 5, function(lhs, rhs) { return is(lhs, 'string') && is(rhs, 'string') && lhs.lastIndexOf(rhs) === lhs.length - rhs.length; } ], '^=': [ 5, function(lhs, rhs) { return is(lhs, 'string') && is(rhs, 'string') && lhs.indexOf(rhs) === 0; } ], '*=': [ 5, function(lhs, rhs) { return is(lhs, 'string') && is(rhs, 'string') && lhs.indexOf(rhs) !== -1; } ], + '-=': [ 5, function(lhs, rhs) { return is(lhs, 'string') && is(rhs, 'string') && lhs.indexOf(rhs) === -1; } ], '>': [ 5, function(lhs, rhs) { return is(lhs, 'number') && is(rhs, 'number') && lhs > rhs || is(lhs, 'string') && is(rhs, 'string') && lhs > rhs; } ], '<': [ 5, function(lhs, rhs) { return is(lhs, 'number') && is(rhs, 'number') && lhs < rhs || is(lhs, 'string') && is(rhs, 'string') && lhs < rhs; } ], '=': [ 3, function(lhs, rhs) { return lhs === rhs; } ], @@ -435,7 +436,7 @@ // THE EVALUATOR function isArray(o) { - return Array.isArray ? Array.isArray(o) : + return Array.isArray ? Array.isArray(o) : toString.call(o) === "[object Array]"; }