index.js 334 B

123456789101112131415
  1. module.exports = Object.setPrototypeOf || ({__proto__:[]} instanceof Array ? setProtoOf : mixinProperties);
  2. function setProtoOf(obj, proto) {
  3. obj.__proto__ = proto;
  4. return obj;
  5. }
  6. function mixinProperties(obj, proto) {
  7. for (var prop in proto) {
  8. if (!obj.hasOwnProperty(prop)) {
  9. obj[prop] = proto[prop];
  10. }
  11. }
  12. return obj;
  13. }