Skip to content

Commit c08282f

Browse files
committed
added os.EOL
1 parent 55bddce commit c08282f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

recipes/crypto-create-credentials/src/workflow.ts

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

34
type TlsImportState = {
@@ -78,8 +79,8 @@ function ensureTlsImport(
7879

7980
const tlsIdentifier = currentState.identifier;
8081
const newImportText = isEsm
81-
? `import * as ${tlsIdentifier} from '${moduleSpecifier}';\n`
82-
: `const ${tlsIdentifier} = require('${moduleSpecifier}');\n`;
82+
? `import * as ${tlsIdentifier} from '${moduleSpecifier}';${os.EOL}`
83+
: `const ${tlsIdentifier} = require('${moduleSpecifier}');${os.EOL}`;
8384

8485
const edit: Edit = {
8586
startPos: firstNode.range().start.index,
@@ -191,7 +192,7 @@ function handleDestructuredImport(
191192
const newEdit = {
192193
startPos: statement.range().end.index,
193194
endPos: statement.range().end.index,
194-
insertedText: `\n${newImportStatement}`,
195+
insertedText: `${os.EOL}${newImportStatement}`,
195196
};
196197
localEdits.push(newEdit);
197198
finalState = { ...currentState, added: true };

0 commit comments

Comments
 (0)