]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
chore: typos
authorEduardo San Martin Morote <posva13@gmail.com>
Fri, 3 Apr 2020 12:01:41 +0000 (14:01 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Fri, 3 Apr 2020 12:01:41 +0000 (14:01 +0200)
12 files changed:
README.md
__tests__/RouterView.spec.ts
__tests__/history/memory.spec.ts
__tests__/matcher/path-parser.spec.ts
__tests__/matcher/path-ranking.spec.ts
src/components/Link.ts
src/history/html5.ts
src/matcher/path-parser-ranker.ts
src/router.ts
src/types/index.ts
src/utils/index.ts
src/utils/query.ts

index 1b2f4cf1b8cbd287f5e879d8101595b2fa693388..5b71363c97929f23b1b98077c0609f5d49aea199 100644 (file)
--- a/README.md
+++ b/README.md
@@ -17,7 +17,7 @@ Since the library is still unstable **and because we want feedback** on bugs and
 
 These are technically breaking changes but they fix an inconsistent behavior.
 
-- Pushing or resolving a non existant named route throws an error instead of navigating to `/` and displaying nothing.
+- Pushing or resolving a non existent named route throws an error instead of navigating to `/` and displaying nothing.
 
 ### Missing features
 
index d728f829aa31f71b389d1958e60b0c37843ee98c..9fdfe5ffdb02bb6b94ef5ca21f49170396630b19 100644 (file)
@@ -144,7 +144,7 @@ describe('RouterView', () => {
       currentRoute: ref(
         markNonReactive({
           ...route,
-          // reset the instances everytime
+          // reset the instances every time
           matched: route.matched.map(match => ({ ...match, instances: {} })),
         })
       ),
index aee86f581c7cd456ea9991c46970f222a26c304d..ded1092d4813ca5913da1aaab3428f0e1a45375a 100644 (file)
@@ -9,11 +9,11 @@ const loc: RawHistoryLocation = '/foo'
 
 const loc2: RawHistoryLocation = '/bar'
 
-const normaliezedLoc: HistoryLocationNormalized = {
+const normalizedLoc: HistoryLocationNormalized = {
   fullPath: '/foo',
 }
 
-const normaliezedLoc2: HistoryLocationNormalized = {
+const normalizedLoc2: HistoryLocationNormalized = {
   fullPath: '/bar',
 }
 
@@ -61,7 +61,7 @@ describe('Memory history', () => {
     history.push(loc)
     history.push(loc2)
     history.back()
-    expect(history.location).toEqual(normaliezedLoc)
+    expect(history.location).toEqual(normalizedLoc)
     history.back()
     expect(history.location).toEqual(START)
   })
@@ -86,9 +86,9 @@ describe('Memory history', () => {
     history.back()
     expect(history.location).toEqual(START)
     history.forward()
-    expect(history.location).toEqual(normaliezedLoc)
+    expect(history.location).toEqual(normalizedLoc)
     history.forward()
-    expect(history.location).toEqual(normaliezedLoc2)
+    expect(history.location).toEqual(normalizedLoc2)
   })
 
   it('can push in the middle of the history', () => {
@@ -99,10 +99,10 @@ describe('Memory history', () => {
     history.back()
     expect(history.location).toEqual(START)
     history.push(loc2)
-    expect(history.location).toEqual(normaliezedLoc2)
+    expect(history.location).toEqual(normalizedLoc2)
     // does nothing
     history.forward()
-    expect(history.location).toEqual(normaliezedLoc2)
+    expect(history.location).toEqual(normalizedLoc2)
   })
 
   it('can listen to navigations', () => {
@@ -112,14 +112,14 @@ describe('Memory history', () => {
     history.push(loc)
     history.back()
     expect(spy).toHaveBeenCalledTimes(1)
-    expect(spy).toHaveBeenCalledWith(START, normaliezedLoc, {
+    expect(spy).toHaveBeenCalledWith(START, normalizedLoc, {
       direction: 'back',
       distance: -1,
       type: 'pop',
     })
     history.forward()
     expect(spy).toHaveBeenCalledTimes(2)
-    expect(spy).toHaveBeenLastCalledWith(normaliezedLoc, START, {
+    expect(spy).toHaveBeenLastCalledWith(normalizedLoc, START, {
       direction: 'forward',
       distance: 1,
       type: 'pop',
index 446d274d6b7e87a84c772f0844577d44b4ed1f84..29459bcd2384b2fb9438a0dec93308d5a5b12b79 100644 (file)
@@ -552,7 +552,7 @@ describe('Path parser', () => {
       matchParams('/home', '/', null)
     })
 
-    it('allows an empty rooot', () => {
+    it('allows an empty root', () => {
       matchParams('', '/', {})
     })
 
@@ -624,6 +624,7 @@ describe('Path parser', () => {
       matchParams('/a/:a(?:b-([^/]+\\)?)', '/a/b-', {
         a: '',
       })
+      // non optional
       matchParams('/a/:a(?:b-([^/]+\\))', '/a/b-one', {
         a: 'one',
       })
@@ -768,6 +769,6 @@ describe('Path parser', () => {
       matchStringify('/:a*/other', {}, '/other')
     })
 
-    // end of stringifying urls
+    // end of generating urls
   })
 })
index cc5f91adfe4f4c7d4a9cfbb2389c5b0c3a7287d7..3006e39c9f90c0a4cc7474775044ba98459a3e4f 100644 (file)
@@ -136,7 +136,7 @@ describe('Path ranking', () => {
     ])
   })
 
-  it('puts the slash before optional paramateres', () => {
+  it('puts the slash before optional parameters', () => {
     possibleOptions.forEach(options => {
       checkPathOrder(['/', ['/:a?', options]])
       checkPathOrder(['/', ['/:a*', options]])
@@ -163,7 +163,7 @@ describe('Path ranking', () => {
     ])
   })
 
-  it('orders repeteable and optional', () => {
+  it('orders repeatable and optional', () => {
     possibleOptions.forEach(options => {
       checkPathOrder(['/:w', ['/:w?', options]])
       checkPathOrder(['/:w?', ['/:w+', options]])
@@ -188,7 +188,7 @@ describe('Path ranking', () => {
     checkPathOrder(['/a/b/c/d/e', '/:k/b/c/d/e', '/:k/b/c/d/:j'])
   })
 
-  it('prioritises custom regex', () => {
+  it('prioritizes custom regex', () => {
     checkPathOrder(['/:a(\\d+)', '/:a', '/:a(.*)'])
     checkPathOrder(['/b-:a(\\d+)', '/b-:a', '/b-:a(.*)'])
   })
index 3aa9f5d8d1c7a23c68acac6a96073a43e92a553c..89dc854d3fa681adc2f4fa2fe240f7ac1a2975e4 100644 (file)
@@ -119,19 +119,19 @@ function guardEvent(e: MouseEvent) {
 }
 
 function includesParams(
-  outter: RouteLocation['params'],
+  outer: RouteLocation['params'],
   inner: RouteLocation['params']
 ): boolean {
   for (let key in inner) {
     let innerValue = inner[key]
-    let outterValue = outter[key]
+    let outerValue = outer[key]
     if (typeof innerValue === 'string') {
-      if (innerValue !== outterValue) return false
+      if (innerValue !== outerValue) return false
     } else {
       if (
-        !Array.isArray(outterValue) ||
-        outterValue.length !== innerValue.length ||
-        innerValue.some((value, i) => value !== outterValue[i])
+        !Array.isArray(outerValue) ||
+        outerValue.length !== innerValue.length ||
+        innerValue.some((value, i) => value !== outerValue[i])
       )
         return false
     }
index 523a4f3e176a9cbf745996c338a4bc135f3f8e99..8475234444570669960324cc69a66d18cb0841bb 100644 (file)
@@ -281,7 +281,7 @@ export default function createWebHistory(base: string = ''): RouterHistory {
     history.go(distance)
   }
   const routerHistory: RouterHistory = {
-    // it's overriden right after
+    // it's overridden right after
     // @ts-ignore
     location: historyNavigation.location.value,
     base,
index 748b6ab69c905506298906ad9e5418e5781d3711..3d6deac26fbefd97232d213cbd75386b201bf828 100644 (file)
@@ -190,7 +190,7 @@ export function tokensToParser(
   if (!options.strict) pattern += '/?'
 
   if (options.end) pattern += '$'
-  // allow paths like /dynamic to only match dynamic or dynamic/... but not dynamic_somethingelse
+  // allow paths like /dynamic to only match dynamic or dynamic/... but not dynamic_something_else
   else if (options.strict) pattern += '(?:/|$)'
 
   const re = new RegExp(pattern, options.sensitive ? '' : 'i')
index 43f3745e2787edfd381fca1150f48ae3fb1d39f1..e69454dee75daa2967c48dd5300df540e655d523 100644 (file)
@@ -576,7 +576,7 @@ function applyRouterPlugin(app: App, router: Router) {
   let started = false
   // TODO: can we use something that isn't a mixin?
   // TODO: this initial navigation is only necessary on client, on server it doesn't make sense
-  // because it will create an extra unecessary navigation and could lead to problems
+  // because it will create an extra unnecessary navigation and could lead to problems
   if (isClient)
     app.mixin({
       beforeCreate() {
index 0e0f34d39e62595b16f2f05855b4c74c1de6c659..043b63acc1cc824e797488c6e79eca5f1127de8b 100644 (file)
@@ -153,7 +153,7 @@ export interface RouteComponentInterface {
    * that is rendering this component.
    * @param to - RouteLocationRaw we are navigating to
    * @param from - RouteLocationRaw we are navigating from
-   * @param next - function to validate, cancel or modify (by redirectering) the navigation
+   * @param next - function to validate, cancel or modify (by redirecting) the navigation
    */
   beforeRouteLeave?: NavigationGuard
   /**
@@ -162,7 +162,7 @@ export interface RouteComponentInterface {
    * the query or the hash.
    * @param to - RouteLocationRaw we are navigating to
    * @param from - RouteLocationRaw we are navigating from
-   * @param next - function to validate, cancel or modify (by redirectering) the navigation
+   * @param next - function to validate, cancel or modify (by redirecting) the navigation
    */
   beforeRouteUpdate?: NavigationGuard
 }
@@ -201,7 +201,7 @@ export interface _RouteRecordBase {
   // TODO: beforeEnter has no effect with redirect, move and test
   beforeEnter?: NavigationGuard<undefined> | NavigationGuard<undefined>[]
   /**
-   * Arbitraty data attached to the record.
+   * Arbitrary data attached to the record.
    */
   meta?: Record<string | number | symbol, any>
   // TODO: only allow a subset?
index b34cb1a3036269d37b687be1a6e5ca6e06a8c828..17969f45e1b5cbaf79d1655526c98fd08ef48589 100644 (file)
@@ -41,14 +41,14 @@ export function extractComponentsGuards(
           record.components[name] = resolvedComponent
           const guard = resolvedComponent[guardType]
           return (
-            // @ts-ignore: the guard matcheds the instance type
+            // @ts-ignore: the guards matched the instance type
             guard && guardToPromiseFn(guard, to, from, record.instances[name])()
           )
         })
       } else {
         const guard = rawComponent[guardType]
         guard &&
-          // @ts-ignore: the guard matcheds the instance type
+          // @ts-ignore: the guards matched the instance type
           guards.push(guardToPromiseFn(guard, to, from, record.instances[name]))
       }
     }
index caee46d68571b33df1633aedb83883b491fea740..2d8c053a3677c25641b85bb96991f82d2fc0c51d 100644 (file)
@@ -7,7 +7,7 @@ import { decode, encodeQueryProperty } from '../utils/encoding'
  */
 export type LocationQueryValue = string | null
 /**
- * Possible values when definining a query
+ * Possible values when defining a query
  *
  * @internal
  */
@@ -74,7 +74,7 @@ export function parseQuery(search: string): LocationQuery {
  * doesn't prepend a `?`
  *
  * @param query - query object to stringify
- * @returns string verion of the query without the leading `?`
+ * @returns string version of the query without the leading `?`
  */
 export function stringifyQuery(query: LocationQueryRaw): string {
   let search = ''