comparisons
Advanced tools
Comparing version 3.0.0 to 3.0.1
@@ -267,2 +267,18 @@ const sift = require('sift').default; | ||
}); | ||
describe('isAcceptableParam', () => { | ||
it('should accept', () => { | ||
expect(Comparison.isAcceptableParam('foo')).toBeFalsy(); | ||
expect(Comparison.isAcceptableParam(['foo'])).toBeTruthy(); | ||
expect( | ||
Comparison.isAcceptableParam(['foo', { operand: '$or' }]), | ||
).toBeTruthy(); | ||
expect( | ||
Comparison.isAcceptableParam({ operand: '$or' }), | ||
).toBeTruthy(); | ||
expect( | ||
Comparison.isAcceptableParam(['foo', ['bar']]), | ||
).toBeTruthy(); | ||
}); | ||
}); | ||
}); |
@@ -132,3 +132,6 @@ const flat = require('flat'); | ||
return ( | ||
(Array.isArray(item) && item.every((rule) => isString(rule))) || | ||
(Array.isArray(item) && | ||
item.every( | ||
(rule) => isString(rule) || this.isAcceptableParam(rule), | ||
)) || | ||
(isObject(item) && 'operand' in item) | ||
@@ -135,0 +138,0 @@ ); |
{ | ||
"name": "comparisons", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"main": "lib/index.js", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25066
684