htc 7ca38fdcbb 善行少年PC端首次提交(基础版) 10 ay önce
..
.github 7ca38fdcbb 善行少年PC端首次提交(基础版) 10 ay önce
test 7ca38fdcbb 善行少年PC端首次提交(基础版) 10 ay önce
.eslintrc 7ca38fdcbb 善行少年PC端首次提交(基础版) 10 ay önce
.nycrc 7ca38fdcbb 善行少年PC端首次提交(基础版) 10 ay önce
CHANGELOG.md 7ca38fdcbb 善行少年PC端首次提交(基础版) 10 ay önce
LICENSE 7ca38fdcbb 善行少年PC端首次提交(基础版) 10 ay önce
Object.setPrototypeOf.d.ts 7ca38fdcbb 善行少年PC端首次提交(基础版) 10 ay önce
Object.setPrototypeOf.js 7ca38fdcbb 善行少年PC端首次提交(基础版) 10 ay önce
README.md 7ca38fdcbb 善行少年PC端首次提交(基础版) 10 ay önce
Reflect.setPrototypeOf.d.ts 7ca38fdcbb 善行少年PC端首次提交(基础版) 10 ay önce
Reflect.setPrototypeOf.js 7ca38fdcbb 善行少年PC端首次提交(基础版) 10 ay önce
index.d.ts 7ca38fdcbb 善行少年PC端首次提交(基础版) 10 ay önce
index.js 7ca38fdcbb 善行少年PC端首次提交(基础版) 10 ay önce
package.json 7ca38fdcbb 善行少年PC端首次提交(基础版) 10 ay önce
tsconfig.json 7ca38fdcbb 善行少年PC端首次提交(基础版) 10 ay önce

README.md

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