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 0456c9f commit 7a8f350Copy full SHA for 7a8f350
detector/src/reporters/Input.ts
@@ -1,12 +1,14 @@
1
import fs from 'node:fs/promises';
2
+import * as path from 'path';
3
4
export interface Input {
5
readTeamplate: () => Promise<string>;
6
}
7
8
export class ReadHtml implements Input {
9
async readTeamplate() : Promise<string> {
- const data = await fs.readFile(`${__dirname}/layout/example.html`, { encoding: 'utf8' });
10
+ const filePath = path.resolve(__dirname, 'layout/example.html');
11
+ const data = await fs.readFile(filePath, { encoding: 'utf8' });
12
return data;
13
14
0 commit comments