Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@based/db-query

Package Overview
Dependencies
Maintainers
7
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@based/db-query - npm Package Compare versions

Comparing version 2.0.1 to 3.1.0

6

dist/src/ast2rpn/ast2rpn.js

@@ -14,2 +14,4 @@ import { convertNowFilter } from './convertNow.js';

'!=': 'c L',
like: '"toupper" s',
notLike: '"toupper" s L',
exists: 'h',

@@ -77,3 +79,3 @@ notExists: 'h',

isFork: true,
[f.$operator == '!=' ? '$and' : '$or']: [
[['!=', 'notLike'].includes(f.$operator) ? '$and' : '$or']: [
{

@@ -114,3 +116,3 @@ $operator: f.$operator,

}
if (vType == 'string' && f.$operator == 'has') {
if (f.$operator === 'has') {
out += ` $${valueId} $${fieldId} ${op}`;

@@ -117,0 +119,0 @@ }

@@ -29,2 +29,4 @@ import isFork from './isFork.js';

'!=',
'like',
'notLike',
'has',

@@ -45,2 +47,13 @@ 'includes',

};
if (filterOpt.$caseInsensitive) {
if (o === '=') {
filter.$operator = 'like';
}
else if (o === '!=') {
filter.$operator = 'notLike';
}
else {
return [{ isFork: true }, `$caseInsensitive is only valid with '=' and '!='`];
}
}
if (o !== 'notExists' && o !== 'exists') {

@@ -47,0 +60,0 @@ filter.$value = isGeoFilterValue(filterOpt)

@@ -10,2 +10,3 @@ export type Value = (string | number) | (string | number)[];

};
$caseInsensitive?: undefined;
$and?: Filter;

@@ -18,2 +19,3 @@ $or?: Filter;

$value?: undefined;
$caseInsensitive?: undefined;
$and?: Filter;

@@ -26,2 +28,3 @@ $or?: Filter;

$value: string | number | (string | number)[];
$caseInsensitive?: boolean;
$and?: Filter;

@@ -32,3 +35,3 @@ $or?: Filter;

$field: string;
$operator: '=' | '>' | '<' | '..' | '!=' | 'has' | 'includes' | 'distance' | 'exists' | 'notExists' | 'textSearch';
$operator: '=' | '!=' | '>' | '<' | '..' | 'like' | 'notLike' | 'has' | 'includes' | 'distance' | 'exists' | 'notExists' | 'textSearch';
$value?: Value;

@@ -35,0 +38,0 @@ hasNow?: true;

{
"name": "@based/db-query",
"version": "2.0.1",
"version": "3.1.0",
"license": "MIT",

@@ -32,3 +32,3 @@ "main": "dist/src/index.js",

"@types/node": "^17.0.23",
"ava": "5.3.1",
"ava": "6.1.1",
"ts-node": "10.9.1",

@@ -35,0 +35,0 @@ "typescript": "^5.1.6",

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc