tkd-api/node_modules/get-proto
klaas a662820f3f anpassungen 2025-04-12 21:51:40 +02:00
..
.github anpassungen 2025-04-12 21:51:40 +02:00
test anpassungen 2025-04-12 21:51:40 +02:00
.eslintrc anpassungen 2025-04-12 21:51:40 +02:00
.nycrc anpassungen 2025-04-12 21:51:40 +02:00
CHANGELOG.md anpassungen 2025-04-12 21:51:40 +02:00
LICENSE anpassungen 2025-04-12 21:51:40 +02:00
Object.getPrototypeOf.d.ts anpassungen 2025-04-12 21:51:40 +02:00
Object.getPrototypeOf.js anpassungen 2025-04-12 21:51:40 +02:00
README.md anpassungen 2025-04-12 21:51:40 +02:00
Reflect.getPrototypeOf.d.ts anpassungen 2025-04-12 21:51:40 +02:00
Reflect.getPrototypeOf.js anpassungen 2025-04-12 21:51:40 +02:00
index.d.ts anpassungen 2025-04-12 21:51:40 +02:00
index.js anpassungen 2025-04-12 21:51:40 +02:00
package.json anpassungen 2025-04-12 21:51:40 +02:00
tsconfig.json anpassungen 2025-04-12 21:51:40 +02: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