修复strict默认值问题
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@yizhi/koa-router",
|
"name": "@yizhi/koa-router",
|
||||||
"version": "1.0.2",
|
"version": "1.0.3",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"types": "typing/index.d.ts",
|
"types": "typing/index.d.ts",
|
||||||
"scripts": {},
|
"scripts": {},
|
||||||
|
@ -153,7 +153,7 @@ export class KoaRouter {
|
|||||||
let regexpStr = "^" + regexpItems.join("") + pathname.slice(offset);
|
let regexpStr = "^" + regexpItems.join("") + pathname.slice(offset);
|
||||||
|
|
||||||
//严格模式
|
//严格模式
|
||||||
if (option?.strict) regexpStr += "$";
|
if (option?.strict ?? true) regexpStr += "$";
|
||||||
else regexpStr += "\\b";
|
else regexpStr += "\\b";
|
||||||
|
|
||||||
//生成正则表达式
|
//生成正则表达式
|
||||||
|
Reference in New Issue
Block a user