Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

setprototypeof

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

setprototypeof - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

test/index.js

24

index.js

@@ -1,15 +0,17 @@

module.exports = Object.setPrototypeOf || ({__proto__:[]} instanceof Array ? setProtoOf : mixinProperties);
'use strict'
/* eslint no-proto: 0 */
module.exports = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? setProtoOf : mixinProperties)
function setProtoOf(obj, proto) {
obj.__proto__ = proto;
return obj;
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;
function mixinProperties (obj, proto) {
for (var prop in proto) {
if (!obj.hasOwnProperty(prop)) {
obj[prop] = proto[prop]
}
}
return obj
}
{
"name": "setprototypeof",
"version": "1.1.0",
"version": "1.1.1",
"description": "A small polyfill for Object.setprototypeof",

@@ -8,3 +8,10 @@ "main": "index.js",

"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "standard && mocha",
"testallversions": "npm run node010 && npm run node4 && npm run node6 && npm run node9 && npm run node11",
"testversion": "docker run -it --rm -v $(PWD):/usr/src/app -w /usr/src/app node:${NODE_VER} npm install mocha@${MOCHA_VER:-latest} && npm t",
"node010": "NODE_VER=0.10 MOCHA_VER=3 npm run testversion",
"node4": "NODE_VER=4 npm run testversion",
"node6": "NODE_VER=6 npm run testversion",
"node9": "NODE_VER=9 npm run testversion",
"node11": "NODE_VER=11 npm run testversion"
},

@@ -25,3 +32,7 @@ "repository": {

},
"homepage": "https://github.com/wesleytodd/setprototypeof"
"homepage": "https://github.com/wesleytodd/setprototypeof",
"devDependencies": {
"mocha": "^5.2.0",
"standard": "^12.0.1"
}
}
# Polyfill for `Object.setPrototypeOf`
[![NPM Version](https://img.shields.io/npm/v/setprototypeof.svg)](https://npmjs.org/package/setprototypeof)
[![NPM Downloads](https://img.shields.io/npm/dm/setprototypeof.svg)](https://npmjs.org/package/setprototypeof)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/standard/standard)
A simple cross platform implementation to set the prototype of an instianted object. Supports all modern browsers and at least back to IE8.

@@ -12,16 +16,17 @@

```javascript
var setPrototypeOf = require('setprototypeof');
var setPrototypeOf = require('setprototypeof')
var obj = {};
var obj = {}
setPrototypeOf(obj, {
foo: function() {
return 'bar';
}
});
obj.foo(); // bar
foo: function () {
return 'bar'
}
})
obj.foo() // bar
```
TypeScript is also supported:
```typescript
import setPrototypeOf = require('setprototypeof');
```
import setPrototypeOf = require('setprototypeof')
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc