From 5f2edf3d421404b278cb9a15dd7dfc42a7585f82 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 4 Sep 2021 23:27:11 +1000 Subject: [PATCH] build(deps): update dependency typescript to v4.4.2 (#2321) * build(deps): update dependency typescript to v4.4.2 * fix(web): cast try catch err type to error Typescript 4.x changes the default behaviour of try catch and its err type from `any` to [`unknown`](https://github.com/microsoft/TypeScript/pull/41013). This change ensures that where we rely on said variable it is cast accordingly as an `Error`. Co-authored-by: Renovate Bot Co-authored-by: Amir Zarrinkafsh --- web/package.json | 2 +- web/src/hooks/RemoteCall.ts | 2 +- web/src/views/ResetPassword/ResetPasswordStep2.tsx | 2 +- web/yarn.lock | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/web/package.json b/web/package.json index b4335184..36d34c10 100644 --- a/web/package.json +++ b/web/package.json @@ -69,6 +69,6 @@ "prettier": "2.3.2", "react-scripts": "4.0.3", "react-test-renderer": "17.0.2", - "typescript": "4.3.5" + "typescript": "4.4.2" } } diff --git a/web/src/hooks/RemoteCall.ts b/web/src/hooks/RemoteCall.ts index be26ae18..b0ac5598 100644 --- a/web/src/hooks/RemoteCall.ts +++ b/web/src/hooks/RemoteCall.ts @@ -21,7 +21,7 @@ export function useRemoteCall( setData(res); } catch (err) { console.error(err); - setError(err); + setError(err as Error); } })(); }, [setInProgress, setError, fnCallback]); diff --git a/web/src/views/ResetPassword/ResetPasswordStep2.tsx b/web/src/views/ResetPassword/ResetPasswordStep2.tsx index c1b2a7f5..5755f39a 100644 --- a/web/src/views/ResetPassword/ResetPasswordStep2.tsx +++ b/web/src/views/ResetPassword/ResetPasswordStep2.tsx @@ -73,7 +73,7 @@ const ResetPasswordStep2 = function () { setFormDisabled(true); } catch (err) { console.error(err); - if (err.message.includes("0000052D.")) { + if ((err as Error).message.includes("0000052D.")) { createErrorNotification("Your supplied password does not meet the password policy requirements."); } else { createErrorNotification("There was an issue resetting the password."); diff --git a/web/yarn.lock b/web/yarn.lock index ca930210..7a0025b8 100644 --- a/web/yarn.lock +++ b/web/yarn.lock @@ -11189,10 +11189,10 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@4.3.5: - version "4.3.5" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.5.tgz#4d1c37cc16e893973c45a06886b7113234f119f4" - integrity sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA== +typescript@4.4.2: + version "4.4.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.2.tgz#6d618640d430e3569a1dfb44f7d7e600ced3ee86" + integrity sha512-gzP+t5W4hdy4c+68bfcv0t400HVJMMd2+H9B7gae1nQlBzCqvrXX+6GL/b3GAgyTH966pzrZ70/fRjwAtZksSQ== u2f-api@1.2.1: version "1.2.1"