blob: ae82c6456d48fe14cfc08783c151dbb2c6e9418c [file] [log] [blame]
module.exports = addAttributes;
/*
* Helper function to add additional attributes to an object.
* Does not replace existing attributes if already present.
*/
function addAttributes(obj, attrs) {
for (var key in attrs) {
if (attrs.hasOwnProperty(key) && !obj.hasOwnProperty(key)) {
obj[key] = attrs[key];
}
}
}