Skip to content

kamicane/object

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

[Object: null prototype] utilities

Resources

Stars

Watchers

Forks

Packages

No packages published