@E18e/Object.Defineproperties

1.0.5Last update Aug 9, 2024
by@e18e

object.defineproperties Codemod

Introduction

This codemod replaces instances of the object.defineproperties function with the built-in Object.defineProperties method. This change reduces unnecessary dependencies, leveraging native JavaScript functionality for improved performance and a smaller bundle size.

Before

import object from 'object.defineproperties';
const obj = {};
object.defineproperties(obj, {
prop1: {
value: 42,
writable: true,
},
});

After

const obj = {};
Object.defineProperties(obj, {
prop1: {
value: 42,
writable: true,
},
});

Build custom codemods

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

background illustrationGet Started Now