|
|
há 4 meses atrás | |
|---|---|---|
| .. | ||
| .github | há 4 meses atrás | |
| test | há 4 meses atrás | |
| .eslintrc | há 4 meses atrás | |
| .nycrc | há 4 meses atrás | |
| CHANGELOG.md | há 4 meses atrás | |
| LICENSE | há 4 meses atrás | |
| README.md | há 4 meses atrás | |
| get.d.ts | há 4 meses atrás | |
| get.js | há 4 meses atrás | |
| package.json | há 4 meses atrás | |
| set.d.ts | há 4 meses atrás | |
| set.js | há 4 meses atrás | |
| tsconfig.json | há 4 meses atrás | |
If available, the Object.prototype.__proto__ accessor and mutator, call-bound.
npm install --save dunder-proto
const assert = require('assert');
const getDunder = require('dunder-proto/get');
const setDunder = require('dunder-proto/set');
const obj = {};
assert.equal('toString' in obj, true);
assert.equal(getDunder(obj), Object.prototype);
setDunder(obj, null);
assert.equal('toString' in obj, false);
assert.equal(getDunder(obj), null);
Clone the repo, npm install, and run npm test