pax_global_header00006660000000000000000000000064131563420730014516gustar00rootroot0000000000000052 comment=8fc2c260d8b7da91133edefde49a3df461f220c8 setprototypeof-1.1.0/000077500000000000000000000000001315634207300146235ustar00rootroot00000000000000setprototypeof-1.1.0/LICENSE000066400000000000000000000013271315634207300156330ustar00rootroot00000000000000Copyright (c) 2015, Wes Todd Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. setprototypeof-1.1.0/README.md000066400000000000000000000007641315634207300161110ustar00rootroot00000000000000# Polyfill for `Object.setPrototypeOf` A simple cross platform implementation to set the prototype of an instianted object. Supports all modern browsers and at least back to IE8. ## Usage: ``` $ npm install --save setprototypeof ``` ```javascript var setPrototypeOf = require('setprototypeof'); var obj = {}; setPrototypeOf(obj, { foo: function() { return 'bar'; } }); obj.foo(); // bar ``` TypeScript is also supported: ```typescript import setPrototypeOf = require('setprototypeof'); ```setprototypeof-1.1.0/index.d.ts000066400000000000000000000001351315634207300165230ustar00rootroot00000000000000declare function setPrototypeOf(o: any, proto: object | null): any; export = setPrototypeOf; setprototypeof-1.1.0/index.js000066400000000000000000000005161315634207300162720ustar00rootroot00000000000000module.exports = Object.setPrototypeOf || ({__proto__:[]} instanceof Array ? setProtoOf : mixinProperties); function setProtoOf(obj, proto) { obj.__proto__ = proto; return obj; } function mixinProperties(obj, proto) { for (var prop in proto) { if (!obj.hasOwnProperty(prop)) { obj[prop] = proto[prop]; } } return obj; } setprototypeof-1.1.0/package.json000066400000000000000000000011371315634207300171130ustar00rootroot00000000000000{ "name": "setprototypeof", "version": "1.1.0", "description": "A small polyfill for Object.setprototypeof", "main": "index.js", "typings": "index.d.ts", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "repository": { "type": "git", "url": "https://github.com/wesleytodd/setprototypeof.git" }, "keywords": [ "polyfill", "object", "setprototypeof" ], "author": "Wes Todd", "license": "ISC", "bugs": { "url": "https://github.com/wesleytodd/setprototypeof/issues" }, "homepage": "https://github.com/wesleytodd/setprototypeof" }