Files
api/app/core/utils/misc/attempt-read-file-sync.ts
T
Alexis 010efe75bd Revert "chore: lint all the files"
This reverts commit 4ef387b5bb.
2021-09-07 13:46:23 +09:30

10 lines
199 B
TypeScript

import { readFileSync } from 'fs';
export const attemptReadFileSync = (path: string, fallback: any = undefined) => {
try {
return readFileSync(path, 'utf-8');
} catch {
return fallback;
}
};