radin-scale-api/node_modules/get-proto
mehranz 0eb8fbcf69 update 2026-02-16 15:55:07 +03:30
..
.github update 2026-02-16 15:55:07 +03:30
test update 2026-02-16 15:55:07 +03:30
.eslintrc update 2026-02-16 15:55:07 +03:30
.nycrc update 2026-02-16 15:55:07 +03:30
CHANGELOG.md update 2026-02-16 15:55:07 +03:30
LICENSE update 2026-02-16 15:55:07 +03:30
Object.getPrototypeOf.d.ts update 2026-02-16 15:55:07 +03:30
Object.getPrototypeOf.js update 2026-02-16 15:55:07 +03:30
README.md update 2026-02-16 15:55:07 +03:30
Reflect.getPrototypeOf.d.ts update 2026-02-16 15:55:07 +03:30
Reflect.getPrototypeOf.js update 2026-02-16 15:55:07 +03:30
index.d.ts update 2026-02-16 15:55:07 +03:30
index.js update 2026-02-16 15:55:07 +03:30
package.json update 2026-02-16 15:55:07 +03:30
tsconfig.json update 2026-02-16 15:55:07 +03:30

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