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"; //生成正则表达式