diff --git a/source/Ox/js/Array.js b/source/Ox/js/Array.js index 348d2cf6..71f4d1d1 100644 --- a/source/Ox/js/Array.js +++ b/source/Ox/js/Array.js @@ -318,7 +318,7 @@ Ox.api = function(items, options) { return Ox.sortBy(array, by, map); }, { key: function(args) { - return JSON.stringify([args[1], args[3]]) + return JSON.stringify([args[1], args[3]]); } }); @@ -419,11 +419,9 @@ Ox.api = function(items, options) { function testQuery(item, query) { var match = true; Ox.forEach(query.conditions, function(condition) { - if (condition.conditions) { - match = testQuery(item, condition); - } else { - match = testCondition(item, condition) - } + match = ( + condition.conditions ? testQuery : testCondition + )(item, condition); if ( (query.operator == '&' && !match) || (query.operator == '|' && match) @@ -472,7 +470,7 @@ Ox.find = function(array, string, leading) { index > -1 && matches[index == 0 ? 0 : 1][ lowerCase == string ? 'unshift' : 'push' ](value); - }) + }); return leading ? matches[0] : matches[0].concat(matches[1]); };