Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix: πŸ› refactor #symlink to be compatible w/ strictNullChecks
  • Loading branch information
G-Rath committed Jul 11, 2019
1 parent 40f8337 commit 4148ad3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/volume.ts
Expand Up @@ -1406,8 +1406,9 @@ export class Volume {

symlink(target: TFilePath, path: TFilePath, callback: TCallback<void>);
symlink(target: TFilePath, path: TFilePath, type: TSymlinkType, callback: TCallback<void>);
symlink(target: TFilePath, path: TFilePath, a, b?) {
const [type, callback] = getArgAndCb<TSymlinkType, TCallback<void>>(a, b);
symlink(target: TFilePath, path: TFilePath, a: TSymlinkType | TCallback<void>, b?: TCallback<void>) {
const callback: TCallback<void> = validateCallback(typeof a === 'function' ? a : b);

const targetFilename = pathToFilename(target);
const pathFilename = pathToFilename(path);
this.wrapAsync(this.symlinkBase, [targetFilename, pathFilename], callback);
Expand Down

0 comments on commit 4148ad3

Please sign in to comment.