({ project }, path, options = {})
| 26 | export const readFile: BrowserCommand< |
| 27 | Parameters<BrowserCommands['readFile']> |
| 28 | > = async ({ project }, path, options = {}) => { |
| 29 | const filepath = resolve(project.config.root, path) |
| 30 | assertFileAccess(slash(filepath), project) |
| 31 | // never return a Buffer |
| 32 | if (typeof options === 'object' && !options.encoding) { |
| 33 | options.encoding = 'utf-8' |
| 34 | } |
| 35 | return fsp.readFile(filepath, options) |
| 36 | } |
| 37 | |
| 38 | export const writeFile: BrowserCommand< |
| 39 | Parameters<BrowserCommands['writeFile']> |