File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
recipes/crypto-create-credentials/src Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change
1
+ import * as os from 'os' ;
1
2
import type { SgRoot , Edit , SgNode } from "@codemod.com/jssg-types/main" ;
2
3
3
4
type TlsImportState = {
@@ -78,8 +79,8 @@ function ensureTlsImport(
78
79
79
80
const tlsIdentifier = currentState . identifier ;
80
81
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 } ` ;
83
84
84
85
const edit : Edit = {
85
86
startPos : firstNode . range ( ) . start . index ,
@@ -191,7 +192,7 @@ function handleDestructuredImport(
191
192
const newEdit = {
192
193
startPos : statement . range ( ) . end . index ,
193
194
endPos : statement . range ( ) . end . index ,
194
- insertedText : `\n ${ newImportStatement } ` ,
195
+ insertedText : `${ os . EOL } ${ newImportStatement } ` ,
195
196
} ;
196
197
localEdits . push ( newEdit ) ;
197
198
finalState = { ...currentState , added : true } ;
You can’t perform that action at this time.
0 commit comments