diff options
Diffstat (limited to 'packages/sol-compiler/src/utils/fs_wrapper.ts')
-rw-r--r-- | packages/sol-compiler/src/utils/fs_wrapper.ts | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/packages/sol-compiler/src/utils/fs_wrapper.ts b/packages/sol-compiler/src/utils/fs_wrapper.ts deleted file mode 100644 index a52b50963..000000000 --- a/packages/sol-compiler/src/utils/fs_wrapper.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { promisify } from '@0x/utils'; -import * as fs from 'fs'; -import * as mkdirp from 'mkdirp'; - -export const fsWrapper = { - readdirAsync: promisify<string[]>(fs.readdir), - readFileAsync: promisify<string>(fs.readFile), - writeFileAsync: promisify<undefined>(fs.writeFile), - mkdirpAsync: promisify<undefined>(mkdirp), - doesPathExistSync: fs.existsSync, - rmdirSync: fs.rmdirSync, - removeFileAsync: promisify<undefined>(fs.unlink), - statAsync: promisify<fs.Stats>(fs.stat), - appendFileAsync: promisify<undefined>(fs.appendFile), - accessAsync: promisify<boolean>(fs.access), - doesFileExistAsync: async (filePath: string): Promise<boolean> => { - try { - await fsWrapper.accessAsync( - filePath, - // node says we need to use bitwise, but tslint says no: - fs.constants.F_OK | fs.constants.R_OK, // tslint:disable-line:no-bitwise - ); - } catch (err) { - return false; - } - return true; - }, -}; |