MCPcopy Index your code
hub / github.com/dresende/node-orm2 / mergeConditions

Function mergeConditions

lib/ChainFind.js:303–313  ·  view source on GitHub ↗
(source)

Source from the content-addressed store, hash-verified

301 var assocIds = Object.keys(association.mergeAssocId);
302 var ids = association.model.id;
303 function mergeConditions(source) {
304 for (var i = 0; i < assocIds.length; i++) {
305 if (typeof conditions[assocIds[i]] === "undefined") {
306 conditions[assocIds[i]] = source[ids[i]];
307 } else if (Array.isArray(conditions[assocIds[i]])) {
308 conditions[assocIds[i]].push(source[ids[i]]);
309 } else {
310 conditions[assocIds[i]] = [ conditions[assocIds[i]], source[ids[i]] ];
311 }
312 }
313 }
314
315 if (Array.isArray(value)) {
316 for (var i = 0; i < value.length; i++) {

Callers 1

addChainMethodFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected