17 lines
286 B
JavaScript
17 lines
286 B
JavaScript
|
'use strict'
|
||
|
|
||
|
// simple mutable assign
|
||
|
function assign () {
|
||
|
const args = [].slice.call(arguments).filter(i => i)
|
||
|
const dest = args.shift()
|
||
|
args.forEach(src => {
|
||
|
Object.keys(src).forEach(key => {
|
||
|
dest[key] = src[key]
|
||
|
})
|
||
|
})
|
||
|
|
||
|
return dest
|
||
|
}
|
||
|
|
||
|
module.exports = assign
|