Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.
/ assign Public archive
forked from borderless/assign

Tiny, opinionated deep assign implementation

License

Notifications You must be signed in to change notification settings

418sec/assign

 
 

Repository files navigation

Assign

NPM version NPM downloads Build status Test coverage

Tiny, opinionated deep assign implementation.

Installation

npm install @borderlesslabs/assign --save

Usage

import { assign } from "@borderlesslabs/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

About

Tiny, opinionated deep assign implementation

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • TypeScript 84.0%
  • JavaScript 16.0%