fix filepath when using path input
This commit is contained in:
parent
525f1f0028
commit
4a3e69b7f7
3 changed files with 10 additions and 4 deletions
|
|
@ -126,6 +126,10 @@ export function readFile(path: string): string {
|
|||
return fs.readFileSync(path, 'utf-8')
|
||||
}
|
||||
|
||||
export function readFileBase64(pathParts: string[]): string {
|
||||
return fs.readFileSync(path.resolve(...pathParts)).toString('base64')
|
||||
}
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
function hasErrorCode(error: any): error is {code: string} {
|
||||
return typeof (error && error.code) === 'string'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue