Skip to content

Commit

Permalink
fix: πŸ› refactor #mkdirp to be compatible w/ strictNullChecks
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Rath committed Jul 11, 2019
1 parent d5d7883 commit 6cf0bce
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/volume.ts
Expand Up @@ -1865,7 +1865,9 @@ export class Volume {
mkdirp(path: TFilePath, callback: TCallback<void>);
mkdirp(path: TFilePath, mode: TMode, callback: TCallback<void>);
mkdirp(path: TFilePath, a: TCallback<void> | TMode, b?: TCallback<void>) {
const [mode, callback] = getArgAndCb<TMode, void>(a, b);
const mode: TMode | undefined = typeof a === 'function' ? undefined : a;
const callback: TCallback<void> = validateCallback(typeof a === 'function' ? a : b);

this.mkdir(path, { mode, recursive: true }, callback);
}

Expand Down

0 comments on commit 6cf0bce

Please sign in to comment.