We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8e68e6f commit 2c7296dCopy full SHA for 2c7296d
src/lib/read-file.ts
@@ -7,4 +7,4 @@ import iconv from 'iconv-lite';
7
* Uses iconv-lite to solve some issues with Windows encodings.
8
*/
9
export const readFile = async (file: string, encoding = 'utf-8') =>
10
- /utf-?8/i.test(encoding) ? fs.readFile(file, { encoding }) : iconv.decode(await fs.readFile(file), encoding);
+ /utf-?8/i.test(encoding) ? fs.readFile(file, { encoding: 'utf-8' }) : iconv.decode(await fs.readFile(file), encoding);
0 commit comments