From f1c9c3856f4bdc660697d8b2176f8d2d05ad31ea Mon Sep 17 00:00:00 2001 From: zqran Date: Mon, 14 Feb 2022 18:49:57 +0800 Subject: [PATCH] refactor: modify the parameter type of `access` function (#9596) --- src/access.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/access.ts b/src/access.ts index 2ec89bdd..e823e24b 100644 --- a/src/access.ts +++ b/src/access.ts @@ -1,8 +1,8 @@ /** * @see https://umijs.org/zh-CN/plugins/plugin-access * */ -export default function access(initialState: { currentUser?: API.CurrentUser | undefined }) { - const { currentUser } = initialState || {}; +export default function access(initialState: { currentUser?: API.CurrentUser } | undefined) { + const { currentUser } = initialState ?? {}; return { canAdmin: currentUser && currentUser.access === 'admin', };