blob: 9d29c1a830daed943e3cd8b4b9cd041f01c73c05 [file] [log] [blame]
// Copyright 2015 The Vanadium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
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];
}
}
}