relational-json
Version:
Relation data model for JSON objects
17 lines (13 loc) • 377 B
JavaScript
function mergePutDataWithRowData(row, newO) {
"use strict";
var o = Object.create(null),
k;
for (k in row) {
// ignore relations to other tables
if (row[k] !== undefined && typeof row[k] !== "object") {
o[k] = newO[k] !== undefined ? newO[k] : row[k];
}
}
return o;
}
module.exports = mergePutDataWithRowData;