From fd364fb39389fa1cfafd640f7d963c7cffe23547 Mon Sep 17 00:00:00 2001 From: yizhi <946185759@qq.com> Date: Thu, 5 Dec 2024 08:44:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dstrict=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=80=BC=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/router.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 9463506..03cdbd2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@yizhi/koa-router", - "version": "1.0.2", + "version": "1.0.3", "main": "dist/index.js", "types": "typing/index.d.ts", "scripts": {}, diff --git a/src/router.ts b/src/router.ts index a15fa9d..042507c 100644 --- a/src/router.ts +++ b/src/router.ts @@ -153,7 +153,7 @@ export class KoaRouter { let regexpStr = "^" + regexpItems.join("") + pathname.slice(offset); //严格模式 - if (option?.strict) regexpStr += "$"; + if (option?.strict ?? true) regexpStr += "$"; else regexpStr += "\\b"; //生成正则表达式