潘超林 79770928d5 init: 初始化项目 před 2 týdny
..
.github 79770928d5 init: 初始化项目 před 2 týdny
test 79770928d5 init: 初始化项目 před 2 týdny
.eslintrc 79770928d5 init: 初始化项目 před 2 týdny
.nycrc 79770928d5 init: 初始化项目 před 2 týdny
CHANGELOG.md 79770928d5 init: 初始化项目 před 2 týdny
LICENSE 79770928d5 init: 初始化项目 před 2 týdny
Object.getPrototypeOf.d.ts 79770928d5 init: 初始化项目 před 2 týdny
Object.getPrototypeOf.js 79770928d5 init: 初始化项目 před 2 týdny
README.md 79770928d5 init: 初始化项目 před 2 týdny
Reflect.getPrototypeOf.d.ts 79770928d5 init: 初始化项目 před 2 týdny
Reflect.getPrototypeOf.js 79770928d5 init: 初始化项目 před 2 týdny
index.d.ts 79770928d5 init: 初始化项目 před 2 týdny
index.js 79770928d5 init: 初始化项目 před 2 týdny
package.json 79770928d5 init: 初始化项目 před 2 týdny
tsconfig.json 79770928d5 init: 初始化项目 před 2 týdny

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