From: Link Date: Thu, 21 Jul 2022 07:28:44 +0000 (+0800) Subject: style: code prettier (#1480) X-Git-Tag: v4.1.3~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=583e77dd2a980a7e89b54dff3e72bc2ada3854d3;p=thirdparty%2Fvuejs%2Frouter.git style: code prettier (#1480) --- diff --git a/packages/router/src/navigationGuards.ts b/packages/router/src/navigationGuards.ts index ae9e142f..4f8b519f 100644 --- a/packages/router/src/navigationGuards.ts +++ b/packages/router/src/navigationGuards.ts @@ -137,7 +137,7 @@ export function guardToPromiseFn( const next: NavigationGuardNext = ( valid?: boolean | RouteLocationRaw | NavigationGuardNextCallback | Error ) => { - if (valid === false) + if (valid === false) { reject( createRouterError( ErrorTypes.NAVIGATION_ABORTED, @@ -147,7 +147,7 @@ export function guardToPromiseFn( } ) ) - else if (valid instanceof Error) { + } else if (valid instanceof Error) { reject(valid) } else if (isRouteLocation(valid)) { reject( @@ -165,8 +165,9 @@ export function guardToPromiseFn( // since enterCallbackArray is truthy, both record and name also are record!.enterCallbacks[name!] === enterCallbackArray && typeof valid === 'function' - ) + ) { enterCallbackArray.push(valid) + } resolve() } }