Skip to content

Commit

Permalink
fix: compile error in wrapError
Browse files Browse the repository at this point in the history
  • Loading branch information
favoyang committed Oct 16, 2022
1 parent 9d6a52e commit 9046a8d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ export const PACKAGE_JSON_FILE = 'package.json';
*
* @param error
*/
export function wrapError(err: unknown): VerdaccioError {
const obj = err as object;
export function wrapError(err: unknown): VerdaccioError {
const obj = err as any;
if ('code' in obj && 'message' in obj)
return err;
else if ('message' in obj)
return getInternalError(obj.message as string);
return getInternalError((obj as Error).message);
else
return getInternalError(String(err));
}
Expand Down

0 comments on commit 9046a8d

Please sign in to comment.