Socket
Socket
Sign inDemoInstall

breeze-sequelize

Package Overview
Dependencies
23
Maintainers
5
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.2 to 0.3.0

breeze-sequelize-0.2.3.tgz

16

package.json
{
"name": "breeze-sequelize",
"version": "0.2.2",
"version": "0.3.0",
"description": "Breeze Sequelize server implementation",

@@ -16,11 +16,11 @@ "keywords": [

"dependencies": {
"bluebird": "^3.5.1",
"breeze-client": "*",
"lodash": "^4.17.5",
"sequelize": "^4.36.0",
"toposort": "^1.0.6"
"bluebird": "^3.5.5",
"breeze-client": "^1.7.2",
"lodash": "^4.17.15",
"sequelize": "^5.18.1",
"toposort": "^2.0.2"
},
"devDependencies": {
"mocha": "*",
"chai": "*"
"chai": "^4.2.0",
"mocha": "^6.2.0"
},

@@ -27,0 +27,0 @@ "scripts": {

@@ -6,2 +6,3 @@ var Sequelize = require('sequelize');

var _ = require('lodash');
var Op = Sequelize.Op;

@@ -498,2 +499,3 @@ var EntityQuery = breeze.EntityQuery;

var crit;
var like = _boolOpMap.like.sequelizeOp;
if (this.expr2.visitorMethodName === "litExpr") {

@@ -506,7 +508,7 @@ p2Value = this.expr2.value;

} else if (op == "startswith") {
crit = { like: p2Value + "%" };
crit = { [like]: p2Value + "%" };
} else if (op === "endswith") {
crit = { like: "%" + p2Value };
crit = { [like]: "%" + p2Value };
} else if (op === "contains") {
crit = { like: "%" + p2Value + "%" };
crit = { [like]: "%" + p2Value + "%" };
} else {

@@ -528,7 +530,7 @@ crit = {};

} else if (op === "startswith") {
crit = { like: Sequelize.literal("concat(" + p2Value + ",'%')") };
crit = { [like]: Sequelize.literal("concat(" + p2Value + ",'%')") };
} else if (op === "endswith") {
crit = { like: Sequelize.literal("concat('%'," + p2Value + ")") };
crit = { [like]: Sequelize.literal("concat('%'," + p2Value + ")") };
} else if (op === "contains") {
crit = { like: Sequelize.literal("concat('%'," + p2Value + ",'%')") };
crit = { [like]: Sequelize.literal("concat('%'," + p2Value + ",'%')") };
} else {

@@ -604,3 +606,3 @@ var crit = {};

if (wheres.length > 0) {
result.where = wheres.length == 1 ? wheres[0] : { and: wheres };
result.where = wheres.length == 1 ? wheres[0] : { [Op.and]: wheres };
}

@@ -613,3 +615,3 @@ // q = Sequelize.and(q1, q2);

if (wheres.length > 0) {
result.where = wheres.length == 1 ? wheres[0] : { or: wheres };
result.where = wheres.length == 1 ? wheres[0] : { [Op.or]: wheres };
}

@@ -639,5 +641,6 @@ // q = Sequelize.or(q1, q2);

var r = this.pred.visit(newContext);
include.where = r.where;
include.where = r.where || {};
include.require = true;
if (r.include) include.include = r.include;
return { include: parent.include }
return { include: parent.include };

@@ -794,8 +797,9 @@ },

var results = [], result;
for (var k in q1) {
var keys = Reflect.ownKeys(q1);
for (var k of keys) {
var v = q1[k];
if (k === "or") {
result = { and: [ applyNot(v[0]), applyNot(v[1]) ] };
} else if (k === "and") {
result = { or: [ applyNot(v[0]), applyNot(v[1]) ] };
if (k === Op.or) {
result = { [Op.and]: [ applyNot(v[0]), applyNot(v[1]) ] };
} else if (k === Op.and) {
result = { [Op.or]: [ applyNot(v[0]), applyNot(v[1]) ] };
} else if ( _notOps[k] ) {

@@ -809,3 +813,3 @@ result = {};

} else {
result[k] = { "ne": v };
result[k] = { [Op.ne]: v };
}

@@ -821,3 +825,3 @@ }

// queries should only have a single node
return { "or": results };
return { [Op.or]: results };
}

@@ -835,5 +839,7 @@ }

});
console.trace(parent);
}
function processAndOrClause(where) {
console.log("processAndOrClause", where);
if (where.and) {

@@ -856,10 +862,10 @@ clauses = where.and.map(function (clause) {

var _boolOpMap = {
eq: { not: "ne"},
gt: { sequelizeOp: "gt", not: "le" },
ge: { sequelizeOp: "gte", not: "lt" },
lt: { sequelizeOp: "lt", not: "ge"},
le: { sequelizeOp: "lte", not: "gt" },
ne: { sequelizeOp: "ne", not: "eq" },
in: { sequelizeOp: "in" },
like: { sequelizeOp: "like"}
eq: { not: Op.ne },
gt: { sequelizeOp: Op.gt, not: Op.le },
ge: { sequelizeOp: Op.gte, not: Op.lt },
lt: { sequelizeOp: Op.lt, not: Op.ge },
le: { sequelizeOp: Op.lte, not: Op.gt },
ne: { sequelizeOp: Op.ne, not: Op.eq },
in: { sequelizeOp: Op.in },
like: { sequelizeOp: Op.like }
};

@@ -877,3 +883,14 @@

in: "notIn",
notIn: "in"
notIn: "in",
[Op.gt]: Op.lte,
[Op.lte]: Op.gt,
[Op.gte]: Op.lt,
[Op.lt]: Op.gte,
[Op.ne]: Op.eq,
[Op.like]: Op.notLike,
[Op.notLike]: Op.like,
[Op.in]: Op.notIn,
[Op.notIn]: Op.in
};

@@ -891,4 +908,1 @@

// --------------------------------
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