@E18e/String.Prototype.Padleft

/icons/calendar.svg

Last update

Aug 9, 2024

String.prototype.padLeft Codemod

Introduction

This codemod replaces uses of the String.prototype.padLeft method with the built-in String.prototype.padStart method. The goal is to eliminate the reliance on the less common padLeft method, reducing unnecessary dependencies and simplifying the codebase.

Before

const paddedString = myString.padLeft(5, '0');

After

const paddedString = myString.padStart(5, '0');

Build custom codemods

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

background illustrationGet Started Now