utils/node_modules/validator/es/lib/util/merge.js

12 lines
316 B
JavaScript
Raw Normal View History

2024-02-07 01:33:07 -05:00
export default function merge() {
var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var defaults = arguments.length > 1 ? arguments[1] : undefined;
for (var key in defaults) {
if (typeof obj[key] === 'undefined') {
obj[key] = defaults[key];
}
}
return obj;
}