relational-json
Version:
Relation data model for JSON objects
20 lines (18 loc) • 482 B
JavaScript
/**
* @private
* @summary assumes that ALL possible fields are ALWAYS present on a row
* scans based on current row, to find applicable keys
* @param c
* @param oldO
* @param newO
* @returns {boolean}
*/
function dataDiffers(oldO, newO) {
"use strict";
return Object.keys(oldO).some(function(key) {
if (oldO[key] !== undefined && typeof oldO[key] !== "object") {
return oldO[key] !== newO[key];
}
});
}
module.exports = dataDiffers;