]> git.r.bdr.sh - rbdr/dotfiles/blob
74da11a86a85562ecb9d7def1eb072bae6088c7e
[rbdr/dotfiles] /
1 'use strict';
2
3 var keys = require('../keys')
4 , value = require('../valid-value')
5
6 , max = Math.max;
7
8 module.exports = function (dest, src/*, …srcn*/) {
9 var error, i, l = max(arguments.length, 2), assign;
10 dest = Object(value(dest));
11 assign = function (key) {
12 try { dest[key] = src[key]; } catch (e) {
13 if (!error) error = e;
14 }
15 };
16 for (i = 1; i < l; ++i) {
17 src = arguments[i];
18 keys(src).forEach(assign);
19 }
20 if (error !== undefined) throw error;
21 return dest;
22 };