Skip to content

Commit

Permalink
inline function
Browse files Browse the repository at this point in the history
  • Loading branch information
dnalborczyk committed Jan 21, 2022
1 parent cb8d461 commit 2cea507
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/utils/fs.ts
Expand Up @@ -3,13 +3,8 @@ import { dirname } from './path';

export const { lstat, readdir, readFile, realpath } = fs;

async function mkdirpath(path: string): Promise<void> {
const dir = dirname(path);
await fs.mkdir(dir, { recursive: true });
}

export async function writeFile(dest: string, data: string | Uint8Array): Promise<void> {
await mkdirpath(dest);

const dir = dirname(dest);
await fs.mkdir(dir, { recursive: true });
await fs.writeFile(dest, data);
}

0 comments on commit 2cea507

Please sign in to comment.