1.0.0 ā€¢ Published 2 years ago

@igor.dvlpr/odin v1.0.0

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

šŸ”± Odin šŸ”ŗ

šŸ”± Odin is an Object wrapper that allows you to create objects and set their attributes - all at once! šŸ”ŗ

Usage šŸŽ”

Install it by executing

npm i "@igor.dvlpr/odin"

then, import it into your project, i.e.:

const { odin } = require('@igor.dvlpr/odin')

const cloned = odin({ a: 1, b: 2 }, { c: 3 }) // returns { a: 1, b: 2, c: 3 }

API šŸ“š

odin(target: object, source: object): object

Assigns all properties of the source object to the target object.

target: object - the target object to copy properties to,

source: object - the source object to copy properties from.

Returns the target object.

If the target object is not provided and empty object is returned.

If the source object is not provided the target object is returned unchanged.

For more info, see, shallow copy vs deep copy.