瀏覽代碼

Replace with direct checking

Shaun 2 年之前
父節點
當前提交
e8e7d8bd43
共有 1 個文件被更改,包括 0 次插入2 次删除
  1. 0 2
      src/router.js

+ 0 - 2
src/router.js

@@ -3,7 +3,6 @@ import { URLPattern } from './pattern'
 
 
 export class Router {
 export class Router {
   #patterns = {}
   #patterns = {}
-  #current
 
 
   add (route) {
   add (route) {
     this.#patterns = {
     this.#patterns = {
@@ -17,7 +16,6 @@ export class Router {
     for (const [route, pattern] of Object.entries(this.#patterns)) {
     for (const [route, pattern] of Object.entries(this.#patterns)) {
       const found = URLPattern.match(target.path, pattern)
       const found = URLPattern.match(target.path, pattern)
       if (found) {
       if (found) {
-        this.#current = route
         return found === true ? {} : found
         return found === true ? {} : found
       }
       }
     }
     }