@E18e/Setprototypeof

/icons/calendar.svg

Last update

Aug 9, 2024

setprototypeof Codemod

Introduction

This codemod replaces the usage of the setprototypeof npm module with the built-in Object.setPrototypeOf method. This transformation helps to eliminate unnecessary dependencies, reduce bundle size, and improve performance by leveraging native JavaScript functionality.

Before

import setprototypeof from 'setprototypeof';
const obj = {};
setprototypeof(obj, prototype);

After

const obj = {};
Object.setPrototypeOf(obj, prototype);

Build custom codemods

Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community

background illustrationGet Started Now