1.0.3 • Published 4 years ago

@kamicane/object v1.0.3

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

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