Skip to content

Commit

Permalink
Don't ignore undefined keys in where clauses
Browse files Browse the repository at this point in the history
  • Loading branch information
alxndrsn committed Mar 22, 2019
1 parent adae21f commit 6f69538
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/waterline/utils/query/private/normalize-where-clause.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,13 +298,10 @@ module.exports = function normalizeWhereClause(whereClause, modelIdentity, orm,
// > here, we have to be more forgiving-- both for usability and backwards-compatibility.


// ╔═╗╔╦╗╦═╗╦╔═╗ ╦╔═╔═╗╦ ╦╔═╗ ┬ ┬┬┌┬┐┬ ┬ ╦ ╦╔╗╔╔╦╗╔═╗╔═╗╦╔╗╔╔═╗╔╦╗ ┬─┐┬ ┬┌─┐
// ╚═╗ ║ ╠╦╝║╠═╝ ╠╩╗║╣ ╚╦╝╚═╗ ││││ │ ├─┤ ║ ║║║║ ║║║╣ ╠╣ ║║║║║╣ ║║ ├┬┘├─┤└─┐
// ╚═╝ ╩ ╩╚═╩╩ ╩ ╩╚═╝ ╩ ╚═╝ └┴┘┴ ┴ ┴ ┴ ╚═╝╝╚╝═╩╝╚═╝╚ ╩╝╚╝╚═╝═╩╝ ┴└─┴ ┴└─┘
// Strip out any keys with undefined values.
// Convert undefined keys to null
_.each(_.keys(branch), function (key){
if (_.isUndefined(branch[key])) {
delete branch[key];
branch[key] = null;
}
});

Expand Down

0 comments on commit 6f69538

Please sign in to comment.