@E18e/Array.Prototype.Slice

1.0.5Last update Aug 9, 2024
by@e18e

array.prototype.slice Codemod

Introduction

This codemod replaces instances of the array.prototype.slice module with the native Array.prototype.slice method. By doing this, it eliminates the need for an additional dependency, thus helping to reduce bundle size and improve performance by using built-in JavaScript functionality.

Before

import arraySlice from 'array.prototype.slice';
const slicedArray = arraySlice(array, 1, 3);

After

const slicedArray = array.slice(1, 3);

Build custom codemods

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

background illustrationGet Started Now