Skip to content

Commit 884a44d

Browse files
committed
updated to use destructred import
1 parent f3dde78 commit 884a44d

File tree

1 file changed

+3
-3
lines changed
  • recipes/createCredentials-to-createSecureContext/src

1 file changed

+3
-3
lines changed

recipes/createCredentials-to-createSecureContext/src/workflow.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as os from 'node:os';
1+
import { EOL } from 'node:os';
22
import type { SgRoot, Edit, SgNode } from "@codemod.com/jssg-types/main";
33

44
type TlsImportState = {
@@ -86,7 +86,7 @@ function ensureTlsImport(
8686
}
8787

8888
const tlsIdentifier = currentState.identifier;
89-
const newImportText = `${helpers.createNamespaceImport(tlsIdentifier, 'node:tls')};${os.EOL}`;
89+
const newImportText = `${helpers.createNamespaceImport(tlsIdentifier, 'node:tls')};${EOL}`;
9090
const edit: Edit = {
9191
startPos: firstNode.range().start.index,
9292
endPos: firstNode.range().start.index,
@@ -146,7 +146,7 @@ function handleDestructuredImport(
146146
const newEdit = {
147147
startPos: statement.range().end.index,
148148
endPos: statement.range().end.index,
149-
insertedText: `${os.EOL}${newImportStatement}`,
149+
insertedText: `${EOL}${newImportStatement}`,
150150
};
151151
localEdits.push(newEdit);
152152
finalState = { ...currentState, added: true };

0 commit comments

Comments
 (0)