Socket
Book a DemoInstallSign in
Socket

@borderless/assign

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@borderless/assign

Tiny, opinionated deep assign implementation

latest
Source
npmnpm
Version
1.1.1
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

Assign

NPM version NPM downloads Build status Test coverage

Tiny, opinionated deep assign implementation.

Installation

npm install @borderless/assign --save

Usage

import { assign } from "@borderless/assign";

// Merges objects.
assign({ a: 10 }, { b: 10 }); //=> { a: 10, b: 10 }

// Deep merge of objects.
assign({ a: { b: true }, { a: { c: false } }); //=> { a: { b: true, c: false } }

// Pushes to arrays, overwrites primitives.
assign({ a: 10, b: [1] }, { a: 20, b: [2, 3] }); //=> { a: 20, b: [1, 2, 3] }

License

MIT

Keywords

assign

FAQs

Package last updated on 14 Feb 2021

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