Skip to content

Commit

Permalink
fix: cast error types as TypeScript 4.4 infers them as unknown instea…
Browse files Browse the repository at this point in the history
…d of any (yargs#2016)
  • Loading branch information
ansgarm committed Aug 31, 2021
1 parent d33e997 commit 1c5a0f6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/argsert.ts
Expand Up @@ -73,7 +73,7 @@ export function argsert(
position += 1;
});
} catch (err) {
console.warn(err.stack);
console.warn((err as Error).stack);
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/utils/maybe-async-result.ts
Expand Up @@ -19,7 +19,7 @@ export function maybeAsyncResult<T>(
? result.then((result: T) => resultHandler(result))
: resultHandler(result);
} catch (err) {
return errorHandler(err);
return errorHandler(err as Error);
}
}

Expand Down

0 comments on commit 1c5a0f6

Please sign in to comment.