]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
chore: fix typos (#114)
author易良 <1204183885@qq.com>
Mon, 24 Feb 2020 20:08:21 +0000 (04:08 +0800)
committerGitHub <noreply@github.com>
Mon, 24 Feb 2020 20:08:21 +0000 (21:08 +0100)
src/errors.ts
src/history/html5.ts
src/history/memory.ts
src/matcher/path-tokenizer.ts

index 52502fadaa2e4107c2da792b9a5af13a76508b31..07fa4e41ff477dd223b588f1fe984f91f61d49f3 100644 (file)
@@ -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
index 6e6f09c5a9fe5fbca2d23ae7e3f7fd9f3a517846..d80e8c12787b06df63702d68e9be83fe76b2f7d8 100644 (file)
@@ -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)
 
index 9650419924281db47dfb4527f2f827c71b934cfd..3836ee927a0776de6fbdfe9bf58ec5df2df53f35 100644 (file)
@@ -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
index 7dd85319152d8fd2b79681285e2f9cf7272ee7ae..5b8cbcb0b2f66d1816f60cedc3533e5246ec6c16 100644 (file)
@@ -170,7 +170,7 @@ export function tokenizePath(path: string): Array<Token[]> {
         break
 
       default:
-        crash('Unkwnonw state')
+        crash('Unknown state')
         break
     }
   }