@openreply/aql
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -154,3 +154,4 @@ 'use strict'; | ||
const condition = actualValue => | ||
actualValue.includes(expectedValue); | ||
(_.isString(actualValue) || _.isNumber(actualValue)) && | ||
_.toString(actualValue).includes(expectedValue); | ||
return test(actualValues, condition, options); | ||
@@ -157,0 +158,0 @@ })); |
{ | ||
"name": "@openreply/aql", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "API Query Language - parser and filter", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -39,3 +39,3 @@ 'use strict'; | ||
_.merge(_.cloneDeep($baseObject), { index: -1, name: 'theirName', address: { street: 'theirStreet' } }), | ||
_.merge(_.cloneDeep($baseObject), { index: 0, name: 'otherName' }), | ||
_.merge(_.cloneDeep($baseObject), { index: 0, name: 'otherName', address: { number: 9 } }), | ||
_.assign(_.cloneDeep($baseObject), { index: 1, phones: [{ number: '0345', type: 'other' }] }), | ||
@@ -91,3 +91,3 @@ _.assign(_.cloneDeep($baseObject), { index: 2, phones: [] }), | ||
conditionString: 'eq(address.number,10)', | ||
expectedIndices: [-1, 0, 1, 2, 4, 5] | ||
expectedIndices: [-1, 1, 2, 4, 5] | ||
}, | ||
@@ -155,2 +155,10 @@ { | ||
}, | ||
{ // There was a bug where this would cause an exception | ||
conditionString: 'includes(address.number,foo)', | ||
expectedIndices: [] | ||
}, | ||
{ | ||
conditionString: 'includes(address.number,9)', | ||
expectedIndices: [0] | ||
}, | ||
// nested queries | ||
@@ -157,0 +165,0 @@ { |
31373
580