潘超林 79770928d5 init: 初始化项目 2 weeks ago
..
.github 79770928d5 init: 初始化项目 2 weeks ago
test 79770928d5 init: 初始化项目 2 weeks ago
.eslintrc 79770928d5 init: 初始化项目 2 weeks ago
.nycrc 79770928d5 init: 初始化项目 2 weeks ago
CHANGELOG.md 79770928d5 init: 初始化项目 2 weeks ago
LICENSE 79770928d5 init: 初始化项目 2 weeks ago
README.md 79770928d5 init: 初始化项目 2 weeks ago
get.d.ts 79770928d5 init: 初始化项目 2 weeks ago
get.js 79770928d5 init: 初始化项目 2 weeks ago
package.json 79770928d5 init: 初始化项目 2 weeks ago
set.d.ts 79770928d5 init: 初始化项目 2 weeks ago
set.js 79770928d5 init: 初始化项目 2 weeks ago
tsconfig.json 79770928d5 init: 初始化项目 2 weeks 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