get-proto (1.0.1)

Published 2026-02-24 13:57:12 +00:00 by atheaadmin

Installation

registry=
npm install get-proto@1.0.1
"get-proto": "1.0.1"

About this package

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

Dependencies

Dependencies

ID Version
dunder-proto ^1.0.1
es-object-atoms ^1.0.0

Development Dependencies

ID Version
@arethetypeswrong/cli ^0.17.2
@ljharb/eslint-config ^21.1.1
@ljharb/tsconfig ^0.2.3
@types/tape ^5.8.0
auto-changelog ^2.5.0
eslint =8.8.0
evalmd ^0.0.19
in-publish ^2.0.1
npmignore ^0.3.1
nyc ^10.3.2
safe-publish-latest ^2.0.0
tape ^5.9.0
typescript next

Keywords

get proto prototype getPrototypeOf [[Prototype]]
Details
npm
2026-02-24 13:57:12 +00:00
1
Jordan Harband
MIT
latest
4.4 KiB
Assets (1)
Versions (1) View all
1.0.1 2026-02-24