From 4148ad399a01a8532986e359e726872d0e207885 Mon Sep 17 00:00:00 2001 From: Gareth Jones Date: Thu, 11 Jul 2019 18:22:53 +1200 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20refactor=20`#symlink`=20t?= =?UTF-8?q?o=20be=20compatible=20w/=20`strictNullChecks`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/volume.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/volume.ts b/src/volume.ts index 78fa7124..a9edcf52 100644 --- a/src/volume.ts +++ b/src/volume.ts @@ -1406,8 +1406,9 @@ export class Volume { symlink(target: TFilePath, path: TFilePath, callback: TCallback); symlink(target: TFilePath, path: TFilePath, type: TSymlinkType, callback: TCallback); - symlink(target: TFilePath, path: TFilePath, a, b?) { - const [type, callback] = getArgAndCb>(a, b); + symlink(target: TFilePath, path: TFilePath, a: TSymlinkType | TCallback, b?: TCallback) { + const callback: TCallback = validateCallback(typeof a === 'function' ? a : b); + const targetFilename = pathToFilename(target); const pathFilename = pathToFilename(path); this.wrapAsync(this.symlinkBase, [targetFilename, pathFilename], callback);