mirror of
https://github.com/cypress-io/cypress.git
synced 2026-04-28 10:49:48 -05:00
d01932bf75
* fix: use graceful-fs always, warn in development on sync calls * skip prop linting in some dirs * eslint rules * use AST-based lint rule instead * comment * ignore existsSync * run without nextTick * remove dev warning code * fix order * register TS first * fix tests * fix test * cover new call site * fix new test
17 lines
590 B
TypeScript
17 lines
590 B
TypeScript
/* eslint-disable no-console */
|
|
|
|
import Bluebird from 'bluebird'
|
|
import fsExtra from 'fs-extra'
|
|
|
|
type Promisified<T extends (...args: any) => any>
|
|
= (...params: Parameters<T>) => Bluebird<ReturnType<T>>
|
|
|
|
interface PromisifiedFsExtra {
|
|
statAsync: (path: string | Buffer) => Bluebird<ReturnType<typeof fsExtra.statSync>>
|
|
removeAsync: Promisified<typeof fsExtra.removeSync>
|
|
writeFileAsync: Promisified<typeof fsExtra.writeFileSync>
|
|
pathExistsAsync: Promisified<typeof fsExtra.pathExistsSync>
|
|
}
|
|
|
|
export const fs = Bluebird.promisifyAll(fsExtra) as PromisifiedFsExtra & typeof fsExtra
|