/ etherpad / src / plugin_packages / get-proto /

[ICO]NameLast modifiedSizeDescription
[PARENTDIR]Parent Directory  -  
[DIR]node_modules/3 months ago -  
[DIR]test/3 months ago -  
[TXT]CHANGELOG.md40 years ago1.0K 
[   ]LICENSE40 years ago1.0K 
[TXT]Object.getPrototypeOf.d.ts40 years ago125  
[   ]Object.getPrototypeOf.js40 years ago156  
[TXT]README.md40 years ago1.8K 
[TXT]Reflect.getPrototypeOf.d.ts40 years ago 67  
[   ]Reflect.getPrototypeOf.js40 years ago150  
[TXT]index.d.ts40 years ago126  
[   ]index.js40 years ago821  
[   ]package.json40 years ago2.1K 
[   ]tsconfig.json40 years ago118  
README.md

get-proto Version Badge

github actions coverage License Downloads

npm badge

Robustly get the [[Prototype]] of an object. Uses the best available method.

Getting started

npm install --save get-proto

Usage/Examples

const assert = require('assert');
const getProto = require('get-proto');

const a = { a: 1, b: 2, [Symbol.toStringTag]: 'foo' };
const b = { c: 3, __proto__: a };

assert.equal(getProto(b), a);
assert.equal(getProto(a), Object.prototype);
assert.equal(getProto({ __proto__: null }), null);

Tests

Clone the repo, npm install, and run npm test

Apache/2.4.38 (Debian) Server at www.karls.computer Port 80