zhizhi/backend/coldstart/node_modules/get-proto
飞毛嘴帅气爱 21310c4792 M14-环节4: 热身历史持久化+查询API 2026-03-08 17:56:28 +08:00
..
.github M14-环节4: 热身历史持久化+查询API 2026-03-08 17:56:28 +08:00
test M14-环节4: 热身历史持久化+查询API 2026-03-08 17:56:28 +08:00
.eslintrc M14-环节4: 热身历史持久化+查询API 2026-03-08 17:56:28 +08:00
.nycrc M14-环节4: 热身历史持久化+查询API 2026-03-08 17:56:28 +08:00
CHANGELOG.md M14-环节4: 热身历史持久化+查询API 2026-03-08 17:56:28 +08:00
LICENSE M14-环节4: 热身历史持久化+查询API 2026-03-08 17:56:28 +08:00
Object.getPrototypeOf.d.ts M14-环节4: 热身历史持久化+查询API 2026-03-08 17:56:28 +08:00
Object.getPrototypeOf.js M14-环节4: 热身历史持久化+查询API 2026-03-08 17:56:28 +08:00
README.md M14-环节4: 热身历史持久化+查询API 2026-03-08 17:56:28 +08:00
Reflect.getPrototypeOf.d.ts M14-环节4: 热身历史持久化+查询API 2026-03-08 17:56:28 +08:00
Reflect.getPrototypeOf.js M14-环节4: 热身历史持久化+查询API 2026-03-08 17:56:28 +08:00
index.d.ts M14-环节4: 热身历史持久化+查询API 2026-03-08 17:56:28 +08:00
index.js M14-环节4: 热身历史持久化+查询API 2026-03-08 17:56:28 +08:00
package.json M14-环节4: 热身历史持久化+查询API 2026-03-08 17:56:28 +08:00
tsconfig.json M14-环节4: 热身历史持久化+查询API 2026-03-08 17:56:28 +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