@@ -41,12 +41,12 @@ export function getStdinFilePath(): string {
41
41
export async function readFromStdin ( targetPath : string , verbose : boolean , onEnd ?: Function ) : Promise < void > {
42
42
43
43
let [ encoding , iconv ] = await Promise . all ( [
44
- resolveTerminalEncoding ( verbose ) , // respect terminal encoding when piping into file
45
- import ( '@vscode/iconv-lite-umd' ) , // lazy load encoding module for usage
46
- fs . promises . appendFile ( targetPath , '' ) // make sure file exists right away (https://github.com/microsoft/vscode/issues/155341)
44
+ resolveTerminalEncoding ( verbose ) , // respect terminal encoding when piping into file
45
+ import ( '@vscode/iconv-lite-umd' ) , // lazy load encoding module for usage
46
+ fs . promises . appendFile ( targetPath , '' ) // make sure file exists right away (https://github.com/microsoft/vscode/issues/155341)
47
47
] ) ;
48
48
49
- if ( ! iconv . encodingExists ( encoding ) ) {
49
+ if ( ! iconv . default . encodingExists ( encoding ) ) {
50
50
console . log ( `Unsupported terminal encoding: ${ encoding } , falling back to UTF-8.` ) ;
51
51
encoding = 'utf8' ;
52
52
}
@@ -59,7 +59,7 @@ export async function readFromStdin(targetPath: string, verbose: boolean, onEnd?
59
59
60
60
const appendFileQueue = new Queue ( ) ;
61
61
62
- const decoder = iconv . getDecoder ( encoding ) ;
62
+ const decoder = iconv . default . getDecoder ( encoding ) ;
63
63
64
64
process . stdin . on ( 'data' , chunk => {
65
65
const chunkStr = decoder . write ( chunk ) ;
0 commit comments