|
|
hai 2 semanas | |
|---|---|---|
| .. | ||
| .github | hai 2 semanas | |
| test | hai 2 semanas | |
| .eslintrc | hai 2 semanas | |
| .nycrc | hai 2 semanas | |
| CHANGELOG.md | hai 2 semanas | |
| LICENSE | hai 2 semanas | |
| Object.setPrototypeOf.d.ts | hai 2 semanas | |
| Object.setPrototypeOf.js | hai 2 semanas | |
| README.md | hai 2 semanas | |
| Reflect.setPrototypeOf.d.ts | hai 2 semanas | |
| Reflect.setPrototypeOf.js | hai 2 semanas | |
| index.d.ts | hai 2 semanas | |
| index.js | hai 2 semanas | |
| package.json | hai 2 semanas | |
| tsconfig.json | hai 2 semanas | |
Robustly set the [[Prototype]] of an object. Uses the best available method.
npm install --save set-proto
const assert = require('assert');
const setProto = require('set-proto');
const a = { a: 1, b: 2, [Symbol.toStringTag]: 'foo' };
const b = { c: 3 };
assert.ok(!('c' in a));
setProto(a, b);
assert.ok('c' in a);
Clone the repo, npm install, and run npm test