Socket
Socket
Sign inDemoInstall

comparisons

Package Overview
Dependencies
3
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.0.0 to 3.0.1

16

lib/__tests__/comparison.test.js

@@ -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();
});
});
});

5

lib/index.js

@@ -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 @@ );

2

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc