@E18e/String.Prototype.Trim

/icons/calendar.svg

Last update

Aug 9, 2024

String.prototype.trim Codemod

Introduction

This codemod replaces uses of the String.prototype.trim method from a polyfill or external library with the built-in ES feature. By utilizing the native implementation, it helps reduce unnecessary dependencies and improves both the performance and maintainability of the codebase.

Before

import trim from 'string.prototype.trim';
const cleanString = trim(someString);

After

const cleanString = someString.trim();

Build custom codemods

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

background illustrationGet Started Now