@kamicane/object

1.0.3 • Public • Published

object

[Object: null prototype] utilities

require

const object = require('@kamicane/object')

create

object()
object(null)
object({ a: 1, b: 2, c: 3 })

assign

object({ a: 1, b: 2 }, { c: 3 }, { a: 2 })

hasOwn

object.hasOwn({ a: 1 }, 'a')

proper iterators with generator functions

;[...object.keys({ a: 1, b: 2, c: 3 })]
;[...object.values({ a: 1, b: 2, c: 3 })]
;[...object.entries({ a: 1, b: 2, c: 3 })]

While it is easy to imagine that all iterators could be expressed as arrays, this is not true. Arrays must be allocated in their entirety, but iterators are consumed only as necessary and thus can express sequences of unlimited size. - MDN

Dependencies (0)

    Dev Dependencies (1)

    Package Sidebar

    Install

    npm i @kamicane/object

    Weekly Downloads

    5

    Version

    1.0.3

    License

    MIT

    Unpacked Size

    2.3 kB

    Total Files

    5

    Last publish

    Collaborators

    • kamicane