zhizhi/node_modules/get-proto
之之 e8278af831 DEV-004: 钉钉机器人初始化 - 环节2完成 2026-03-06 09:59:01 +08:00
..
.github DEV-004: 钉钉机器人初始化 - 环节2完成 2026-03-06 09:59:01 +08:00
test DEV-004: 钉钉机器人初始化 - 环节2完成 2026-03-06 09:59:01 +08:00
.eslintrc DEV-004: 钉钉机器人初始化 - 环节2完成 2026-03-06 09:59:01 +08:00
.nycrc DEV-004: 钉钉机器人初始化 - 环节2完成 2026-03-06 09:59:01 +08:00
CHANGELOG.md DEV-004: 钉钉机器人初始化 - 环节2完成 2026-03-06 09:59:01 +08:00
LICENSE DEV-004: 钉钉机器人初始化 - 环节2完成 2026-03-06 09:59:01 +08:00
Object.getPrototypeOf.d.ts DEV-004: 钉钉机器人初始化 - 环节2完成 2026-03-06 09:59:01 +08:00
Object.getPrototypeOf.js DEV-004: 钉钉机器人初始化 - 环节2完成 2026-03-06 09:59:01 +08:00
README.md DEV-004: 钉钉机器人初始化 - 环节2完成 2026-03-06 09:59:01 +08:00
Reflect.getPrototypeOf.d.ts DEV-004: 钉钉机器人初始化 - 环节2完成 2026-03-06 09:59:01 +08:00
Reflect.getPrototypeOf.js DEV-004: 钉钉机器人初始化 - 环节2完成 2026-03-06 09:59:01 +08:00
index.d.ts DEV-004: 钉钉机器人初始化 - 环节2完成 2026-03-06 09:59:01 +08:00
index.js DEV-004: 钉钉机器人初始化 - 环节2完成 2026-03-06 09:59:01 +08:00
package.json DEV-004: 钉钉机器人初始化 - 环节2完成 2026-03-06 09:59:01 +08:00
tsconfig.json DEV-004: 钉钉机器人初始化 - 环节2完成 2026-03-06 09:59:01 +08:00

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