1.0.0 • Published 4 years ago
@jacobbubu/xtend v1.0.0
@jacobbubu/xtend
Rewritten xtend in typescript for learning purpose.
Examples
import { extend, mutableExtend } from '@jacobbubu/xtend'
// extend returns a new object. Does not mutate arguments
const combination = extend(
{
a: 'a',
b: 'c'
},
{
b: 'b'
}
)
// combination = { a: "a", b: "b" }
// mutate argument in-place
const a = { foo: 'bar' }
mutableExtend(a, { bar: 'baz' })
// a.bar = 'baz'
1.0.0
4 years ago