@E18e/Es Define Property

1.0.5Last update Aug 9, 2024
by@e18e

es-define-property Codemod

Introduction

This codemod replaces the use of the es-define-property npm module with the built-in Object.defineProperty method from JavaScript. The goal is to reduce the number of dependencies in the codebase, thereby optimizing bundle size and improving overall performance.

Before

import defineProperty from 'es-define-property';
defineProperty(obj, 'key', {
value: 'value',
writable: true,
});

After

Object.defineProperty(obj, 'key', {
value: 'value',
writable: true,
});

Build custom codemods

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

background illustrationGet Started Now