1.0.0 • Published 4 years ago

@jacobbubu/xtend v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

@jacobbubu/xtend

Build Status Coverage Status npm

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'