assign.js 303 B

1234567891011121314
  1. // simple mutable assign
  2. function assign () {
  3. var args = [].slice.call(arguments).filter(function (i) { return i })
  4. var dest = args.shift()
  5. args.forEach(function (src) {
  6. Object.keys(src).forEach(function (key) {
  7. dest[key] = src[key]
  8. })
  9. })
  10. return dest
  11. }
  12. module.exports = assign