Skip to content

Commit 1518b45

Browse files
WIP
1 parent 9c701c1 commit 1518b45

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

recipes/repl-builtin-modules/src/workflow.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,8 @@ export default function transform(root: SgRoot<Js>): string | null {
212212
hasChanges = true;
213213
} else {
214214
// Split into two statements
215-
const newText = originalText.replace(/,?\s*(builtinModules|_builtinLibs)\s*(as\s+\w+)?\s*,?/g, "")
215+
const newText = originalText
216+
.replace(/,?\s*(builtinModules|_builtinLibs)\s*(as\s+\w+)?\s*,?/g, "")
216217
.replace(/,\s*$/, "").replace(/^\s*,/, "");
217218
edits.push(namedImports.replace(newText));
218219

@@ -263,7 +264,10 @@ export default function transform(root: SgRoot<Js>): string | null {
263264
// Get the namespace identifier to maintain consistency
264265
let importIdentifier = importClause.find({ rule: { kind: "identifier" } });
265266
if (!importIdentifier) {
266-
const namespaceImport = importClause.find({ rule: { kind: "namespace_import" } });
267+
const namespaceImport = importClause.find({
268+
rule: { kind: "namespace_import" }
269+
});
270+
267271
if (namespaceImport) {
268272
importIdentifier = namespaceImport.find({ rule: { kind: "identifier" } });
269273
}

0 commit comments

Comments
 (0)