Set the proto of an object.
$ npm install @f/set-proto
var setProto = require('@f/set-proto')
var man = {talk: () => 'hello'}
var cat = {talk: () => 'meow'}
var obj = {}
setProto(man, obj)
obj.talk() // => 'hello'
setProto(cat, obj)
obj.talk() // => 'meow'
proto
- The object's new prototype.obj
- The object which is to have its prototype set.
Returns: obj
MIT