npm install blood --save
blood.child(parent)
create object that inheritsparent
(emulatesObject.create
)blood.create(parent)
alias forblood.child(parent)
blood.orphan()
emulatesObject.create(null)
blood.twin(object)
create twin objectblood.combine(keys, values)
create object from corresponding keys and values arraysblood.pair(pairs)
create object from pairsblood.invert(object)
create new object by inverting keys and values
blood.assign(to, ...from)
emulates ES6Object.assign
blood.adopt(...from)
assign tothis
blood.foster(child, parent)
force child to have a new parent (ES6+)
blood.has(object, key)
test ifobject
ownskey
blood.parent(object)
emulatesObject.getPrototypeOf
blood.parents(object)
get array of parents (up the prototype chain)blood.chain(object)
equals[object].concat(blood.parents(object))
blood.keys(object)
emulatesObject.keys
blood.names(object)
emulatesObject.getOwnPropertyNames
blood.values(object)
get array of own enumerable valuesblood.methods(object)
get array of own enumerable functionsblood.enums(object)
get array of all enumerable valuesblood.pairs(object)
get array of[key, value]
pairs
npm install
npm test
Works in Node.js and modern browsers (ES5+ except where noted ES6+)