set-proto (1.0.0)

Published 2026-02-24 14:04:58 +00:00 by atheaadmin

Installation

registry=
npm install set-proto@1.0.0
"set-proto": "1.0.0"

About this package

set-proto Version Badge

github actions coverage License Downloads

npm badge

Robustly set the Prototype of an object. Uses the best available method.

Getting started

npm install --save set-proto

Usage/Examples

const assert = require('assert');
const setProto = require('set-proto');

const a = { a: 1, b: 2, [Symbol.toStringTag]: 'foo' };
const b = { c: 3 };

assert.ok(!('c' in a));

setProto(a, b);

assert.ok('c' in a);

Tests

Clone the repo, npm install, and run npm test

Dependencies

Dependencies

ID Version
dunder-proto ^1.0.1
es-errors ^1.3.0
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

set proto prototype setPrototypeOf [[Prototype]]
Details
npm
2026-02-24 14:04:58 +00:00
1
Jordan Harband
MIT
latest
4.1 KiB
Assets (1)
Versions (1) View all
1.0.0 2026-02-24