yangfei d6462fcff2 1 3 days ago
..
.github d6462fcff2 1 3 days ago
test d6462fcff2 1 3 days ago
.eslintrc d6462fcff2 1 3 days ago
.nycrc d6462fcff2 1 3 days ago
CHANGELOG.md d6462fcff2 1 3 days ago
LICENSE d6462fcff2 1 3 days ago
README.md d6462fcff2 1 3 days ago
get.d.ts d6462fcff2 1 3 days ago
get.js d6462fcff2 1 3 days ago
package.json d6462fcff2 1 3 days ago
set.d.ts d6462fcff2 1 3 days ago
set.js d6462fcff2 1 3 days ago
tsconfig.json d6462fcff2 1 3 days ago

README.md

dunder-proto Version Badge

github actions coverage License Downloads

npm badge

If available, the Object.prototype.__proto__ accessor and mutator, call-bound.

Getting started

npm install --save dunder-proto

Usage/Examples

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);

Tests

Clone the repo, npm install, and run npm test