0.0.11 • Published 3 years ago

safe-object-assign v0.0.11

Weekly downloads
2
License
MIT
Repository
github
Last release
3 years ago

safe-object-assign

Sensible wrapper for Object.assign().

Documentation

Object.assign() can return surprising results when a value to be modified is not an object.

The point of safe-object-assign is to allow users to pass anything,

  1. without blowing up,
  2. retain the initial value if it is not an object or array,
  3. obtain a modified copy of the initial object or array to be updated,
  4. mixing only objects or arrays into the new model.

See full details on my blog post at https://dfkaye.com/posts/2020/08/21/safer-object.assign-operations-using-a-sensible-wrapper/

Install

npm install safe-object-assign

OR

git clone https://github.com/dfkaye/safer-object-assign.git

Test

Install dependencies (mocha and chai): npm install safe-object-assign --save-dev

Run: npm test

OR

Visit the live demo running the browser test suite on my blog: https://dfkaye.com/demos/safe-assign-test-suite/.

0.0.11

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.6

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago