es-get-iterator Codemod
Introduction
This codemod replaces the usage of the es-get-iterator
module with native ES features. It converts calls to the getIterator
function into a more efficient form that utilizes the Symbol.iterator
property directly, thus reducing dependency on external libraries.
Before
import { getIterator } from 'es-get-iterator';const iterable = [1, 2, 3];const iterator = getIterator(iterable);
After
const iterable = [1, 2, 3];const iterator = iterable[Symbol.iterator]();
Build custom codemods
Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community