Skip to content

Latest commit

 

History

History
58 lines (39 loc) · 1.1 KB

File metadata and controls

58 lines (39 loc) · 1.1 KB

native-promise

Usage

npx ember-no-rsvp-codemod native-promise path/of/files/ or/some**/*glob.js

# or

yarn global add ember-no-rsvp-codemod
ember-no-rsvp-codemod native-promise path/of/files/ or/some**/*glob.js

Local Usage

node ./bin/cli.js native-promise path/of/files/ or/some**/*glob.js

Input / Output


basic

Input (basic.input.js):

import { Promise, reject, resolve } from 'rsvp';
import Foo from 'foo'; // untouched

async function awaitPromises() {
    await Promise.resolve();

    await reject(new Error('Error'));

    await resolve(123);
}

Output (basic.output.js):

import Foo from 'foo'; // untouched

async function awaitPromises() {
    await Promise.resolve();

    await Promise.reject(new Error('Error'));

    await Promise.resolve(123);
}