From: 易良 <1204183885@qq.com> Date: Mon, 24 Feb 2020 20:08:21 +0000 (+0800) Subject: chore: fix typos (#114) X-Git-Tag: v4.0.0-alpha.1~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db37396ea4377609f04f3f1c95e63ca6bee04772;p=thirdparty%2Fvuejs%2Frouter.git chore: fix typos (#114) --- diff --git a/src/errors.ts b/src/errors.ts index 52502fad..07fa4e41 100644 --- a/src/errors.ts +++ b/src/errors.ts @@ -39,7 +39,7 @@ export class RouterError extends Error { // only IE9 seems to break the inheritance chain // and set Error as the name if (error.name === 'Error') { - // @ts-ignore for IE inheritance suport + // @ts-ignore for IE inheritance support return error[isRouterError] } else { return error instanceof RouterError @@ -73,7 +73,7 @@ export class NoRouteMatchError extends RouterError { // only IE9 seems to break the inheritance chain // and set Error as the name if (error.name === 'Error') { - // @ts-ignore for IE inheritance suport + // @ts-ignore for IE inheritance support return error[isNoRouteMatchError] } else { return error instanceof NoRouteMatchError @@ -94,7 +94,7 @@ export class InvalidRouteMatch extends RouterError { super( `Cannot redirect using a relative location:\n${stringifyRoute( location - )}\nUse the function redirect and explicitely provide a name` + )}\nUse the function redirect and explicitly provide a name` ) } @@ -102,7 +102,7 @@ export class InvalidRouteMatch extends RouterError { // only IE9 seems to break the inheritance chain // and set Error as the name if (error.name === 'Error') { - // @ts-ignore for IE inheritance suport + // @ts-ignore for IE inheritance support return error[isInvalidRouteMatch] } else { return error instanceof InvalidRouteMatch @@ -121,7 +121,7 @@ export class NavigationGuardRedirect extends RouterError { to: RouteLocation from: RouteLocationNormalized - // TODO: refactor order of argumnets + // TODO: refactor order of arguments // TODO: refactor into parent class NavigationError constructor(from: RouteLocationNormalized, to: RouteLocation) { super( @@ -138,7 +138,7 @@ export class NavigationGuardRedirect extends RouterError { // only IE9 seems to break the inheritance chain // and set Error as the name if (error.name === 'Error') { - // @ts-ignore for IE inheritance suport + // @ts-ignore for IE inheritance support return error[isNavigationGuardRedirect] } else { return error instanceof NavigationGuardRedirect @@ -169,7 +169,7 @@ export class NavigationAborted extends RouterError { // only IE9 seems to break the inheritance chain // and set Error as the name if (error.name === 'Error') { - // @ts-ignore for IE inheritance suport + // @ts-ignore for IE inheritance support return error[isNavigationAborted] } else { return error instanceof NavigationAborted @@ -202,7 +202,7 @@ export class NavigationCancelled extends RouterError { // only IE9 seems to break the inheritance chain // and set Error as the name if (error.name === 'Error') { - // @ts-ignore for IE inheritance suport + // @ts-ignore for IE inheritance support return error[isNavigationCancelled] } else { return error instanceof NavigationCancelled diff --git a/src/history/html5.ts b/src/history/html5.ts index 6e6f09c5..d80e8c12 100644 --- a/src/history/html5.ts +++ b/src/history/html5.ts @@ -26,7 +26,7 @@ interface StateEntry extends HistoryState { } /** - * Creates a noramlized history location from a window.location object + * Creates a normalized history location from a window.location object * @param location */ function createCurrentLocation( @@ -69,7 +69,7 @@ function useHistoryListeners( historyState.value = state if (pauseState && pauseState.fullPath === from.fullPath) { - cs.info('❌ Ignored beacuse paused for', pauseState.fullPath) + cs.info('❌ Ignored because paused for', pauseState.fullPath) // reset pauseState pauseState = null return @@ -104,7 +104,7 @@ function useHistoryListeners( } function listen(callback: NavigationCallback) { - // settup the listener and prepare teardown callbacks + // setup the listener and prepare teardown callbacks listeners.push(callback) const teardown = () => { @@ -135,7 +135,7 @@ function useHistoryListeners( window.removeEventListener('beforeunload', beforeUnloadListener) } - // settup the listeners and prepare teardown callbacks + // setup the listeners and prepare teardown callbacks window.addEventListener('popstate', popStateHandler) window.addEventListener('beforeunload', beforeUnloadListener) diff --git a/src/history/memory.ts b/src/history/memory.ts index 96504199..3836ee92 100644 --- a/src/history/memory.ts +++ b/src/history/memory.ts @@ -11,7 +11,7 @@ import { } from './common' /** - * Creates a in-memory based history. The main purporse of this history is to handle SSR. It starts in a special location that is nowhere. + * Creates a in-memory based history. The main purpose of this history is to handle SSR. It starts in a special location that is nowhere. * It's up to the user to replace that location with the starter location. * @param base Base applied to all urls, defaults to '/' * @returns a history object that can be passed to the router constructor diff --git a/src/matcher/path-tokenizer.ts b/src/matcher/path-tokenizer.ts index 7dd85319..5b8cbcb0 100644 --- a/src/matcher/path-tokenizer.ts +++ b/src/matcher/path-tokenizer.ts @@ -170,7 +170,7 @@ export function tokenizePath(path: string): Array { break default: - crash('Unkwnonw state') + crash('Unknown state') break } }