@igor.dvlpr/odin
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

🔱 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.


NOTE: this function uses the method of shallow copying of the source object, for deep/true copied objects consider using clone.js.

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

Package Sidebar

Install

npm i @igor.dvlpr/odin

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

5.06 kB

Total Files

5

Last publish

Collaborators

  • igor.dvlpr