npm.io
1.0.0 • Published 8 months ago

dunder-proto-x

Licence
MIT
Version
1.0.0
Deps
4
Size
6 kB
Vulns
0
Weekly
0

dunder-proto-x

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

Getting started

npm install --save dunder-proto-x

Usage/Examples

const assert = require('assert')
const getDunder = require('dunder-proto-x/get')
const setDunder = require('dunder-proto-x/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

Keywords