object-iterate
Iterate over object with
map
,each
andfilter
Usage
$ npm i object-iterate
const Iterable = var o = // get only props that have boolean values // map object by concating key and value // log each new value // Object.keys cached for better experience, // so for deleting/setting props and also better perfomance, // it is better to use builtin methods like set, kill, forceKill o // will remove a from object, ! but wont update cache // so if u then iterate over object with each or map you will get a as undefined o // reinit cache calling Object.keys, so now it's actually up-to-date o // will kill and call force
API
Iterable.each
iterate over object and evaluate callback
callback params
value
prop valuekey
obviously keyobj
iterable object
iterable
Iterable.map
map over object and return new object calling callback on each prop
callback params
value
prop valuekey
obviously keyobj
iterable object
iterable
Iterable.filter
filtering object calling callback on each prop
callback params
value
prop valuekey
obviously keyobj
iterable object
iterable
Iterable.set
set new prop on object
iterable
Iterable.kill
delete prop on object, but not force cache revaluating
iterable
Iterable.force
reinitializing cached variables
iterable
Iterable.forceKill
helper for kill + force combo
iterable
license
MIT