1.5.5 • Published 1 year ago

to-extend v1.5.5

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago
  • Untainted input sources
  • Deeply extend
  • Return the extended result
  • Common extensions for configuration and options

Getting Started

npm install to-extend

Usage

import extend from 'to-extend'

extend({ a: 1, b:2 }, { b: null, c:3 })
// { a:1, b: null, c:3 }

Overview

expect(
    extend(
        {
            a: 1,
            b: 2,
            d: {
                a: 1,
                b: [],
                c: { test1: 123, test2: 321 }
            },
            f: 5,
            g: 123,
            i: 321,
            j: [1, 2]
        },
        {
            b: 3,
            c: 5,
            d: {
                b: { first: 'one', second: 'two' },
                c: { test2: 222 }
            },
            e: { one: 1, two: 2 },
            f: [],
            g: (void 0),
            h: /abc/g,
            i: null,
            j: [3, 4]
        }
    )
)
    .toEqual({
        a: 1,
        b: 3,
        d:
        {
            a: 1,
            b: { first: 'one', second: 'two' },
            c: { test1: 123, test2: 222 }
        },
        f: [],
        g: undefined,
        c: 5,
        e: { one: 1, two: 2 },
        h: /abc/g,
        i: null,
        j: [3, 4]
    })

Inspiration

1.5.5

1 year ago

1.5.4

1 year ago

1.5.3

1 year ago

1.5.2

1 year ago

1.5.1

1 year ago

1.5.0

1 year ago

1.4.6

1 year ago

1.4.5

1 year ago

1.4.4

1 year ago

1.4.3

1 year ago

1.4.2

1 year ago

1.4.1

1 year ago

1.4.0

1 year ago

1.3.1

1 year ago

1.3.0

1 year ago

1.2.0

1 year ago

1.1.0

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago