🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

@techor/extend

Package Overview
Dependencies
Maintainers
1
Versions
119
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@techor/extend

Deeply extend objects

2.6.7
Source
npm
Version published
Weekly downloads
396
-6.6%
Maintainers
1
Weekly downloads
 
Created
Source

Deeply extend objects ~400B

NPM Version NPM Version NPM package ( download / month ) Follow @mastercorg Github release actions


  • Untainted input sources
  • Deeply extend
  • Return the extended result
  • Common extensions for configuration and options

Getting Started

npm install @techor/extend

Usage

import extend from '@techor/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


NPM Version

Keywords

extend

FAQs

Package last updated on 16 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts