@E18e/String.Prototype.Padstart

1.0.5Last update Aug 9, 2024
by@e18e

String Prototype PadStart Codemod

Introduction

This codemod replaces the outdated use of string.prototype.padstart with the modern padStart method. This update improves code readability and ensures the use of native JavaScript features, which can help reduce bundle size and enhance performance.

Before

const paddedString = '5'.prototype.padstart(3, '0');

After

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

Build custom codemods

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

background illustrationGet Started Now