@E18e/Promise.Prototype.Finally

1.0.5Last update Aug 9, 2024
by@e18e

Promise.prototype Finally Codemod

Introduction

This codemod replaces the usage of the promise.prototype.finally polyfill with the native finally method provided by JavaScript's Promise API. This update not only aligns the codebase with modern JavaScript standards but also helps in reducing unnecessary dependencies, leading to a smaller bundle size and improved performance.

Before

import promiseFinally from 'promise.prototype.finally';
promiseFinally();
const result = promiseFinally(promise, callback);

After

const result = promise.finally(callback);

Build custom codemods

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

background illustrationGet Started Now