Socket
Socket
Sign inDemoInstall

dbgate-sqltree

Package Overview
Dependencies
1
Maintainers
1
Versions
125
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.2.2 to 5.2.3

16

lib/evaluateCondition.js

@@ -7,3 +7,4 @@ "use strict";

exports.evaluateCondition = void 0;
const lodash_1 = __importDefault(require("lodash"));
const cloneDeepWith_1 = __importDefault(require("lodash/cloneDeepWith"));
const escapeRegExp_1 = __importDefault(require("lodash/escapeRegExp"));
const evaluateExpression_1 = require("./evaluateExpression");

@@ -20,3 +21,3 @@ function isEmpty(value) {

return false;
const regex = new RegExp(`^${lodash_1.default.escapeRegExp(test).replace(/%/g, '.*')}$`, 'i');
const regex = new RegExp(`^${(0, escapeRegExp_1.default)(test).replace(/%/g, '.*')}$`, 'i');
const res = !!value.toString().match(regex);

@@ -65,4 +66,15 @@ return res;

return !evaluateCondition(condition.condition, values);
case 'anyColumnPass':
return Object.keys(values).some(columnName => {
const replaced = (0, cloneDeepWith_1.default)(condition.placeholderCondition, (expr) => {
if (expr.exprType == 'placeholder')
return {
exprType: 'column',
columnName,
};
});
return evaluateCondition(replaced, values);
});
}
}
exports.evaluateCondition = evaluateCondition;

@@ -89,3 +89,7 @@ import type { NamedObjectInfo, RangeDefinition, TransformType } from 'dbgate-types';

}
export declare type Condition = BinaryCondition | NotCondition | TestCondition | CompoudCondition | LikeCondition | ExistsCondition | NotExistsCondition | BetweenCondition | InCondition | RawTemplateCondition;
export interface AnyColumnPassEvalOnlyCondition {
conditionType: 'anyColumnPass';
placeholderCondition: Condition;
}
export declare type Condition = BinaryCondition | NotCondition | TestCondition | CompoudCondition | LikeCondition | ExistsCondition | NotExistsCondition | BetweenCondition | InCondition | RawTemplateCondition | AnyColumnPassEvalOnlyCondition;
export interface Source {

@@ -92,0 +96,0 @@ name?: NamedObjectInfo;

4

package.json
{
"version": "5.2.2",
"version": "5.2.3",
"name": "dbgate-sqltree",

@@ -30,3 +30,3 @@ "main": "lib/index.js",

"@types/node": "^13.7.0",
"dbgate-types": "^5.2.2",
"dbgate-types": "^5.2.3",
"typescript": "^4.4.3"

@@ -33,0 +33,0 @@ },

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