Skip to content

Commit 5f4e015

Browse files
authored
Make transformer async (#258)
1 parent d141262 commit 5f4e015

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

.changeset/nice-tigers-confess.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"aws-sdk-js-codemod": patch
3+
---
4+
5+
Make transformer async

src/transforms/v2-to-v3/transformer.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ describe("v2-to-v3", () => {
4242
async (filePrefix, fileExtension) => {
4343
const { input, outputCode } = await getTestMetadata(subDirPath, filePrefix, fileExtension);
4444

45-
const output = transform(input, {
45+
const output = await transform(input, {
4646
j: jscodeshift,
4747
jscodeshift,
4848
// eslint-disable-next-line @typescript-eslint/no-empty-function

src/transforms/v2-to-v3/transformer.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
replaceTSTypeReference,
1515
} from "./utils";
1616

17-
export default function transformer(file: FileInfo, api: API) {
17+
const transformer = async (file: FileInfo, api: API) => {
1818
const j = isTypeScriptFile(file.path) ? api.jscodeshift.withParser("ts") : api.jscodeshift;
1919
const source = j(file.source);
2020

@@ -56,4 +56,6 @@ export default function transformer(file: FileInfo, api: API) {
5656
}
5757

5858
return source.toSource();
59-
}
59+
};
60+
61+
export default transformer;

0 commit comments

Comments
 (0)