parent
1e08003ba7
commit
5136605322
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "wkitd",
|
"name": "wkitd",
|
||||||
"version": "1.3.1",
|
"version": "1.3.2",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"files": [
|
"files": [
|
||||||
|
|
|
@ -64,7 +64,7 @@ class Router {
|
||||||
|
|
||||||
re = route.path.replace(
|
re = route.path.replace(
|
||||||
RULE_REGEXP,
|
RULE_REGEXP,
|
||||||
function (m, _prefix, _var, _require) {
|
function (m, _prefix, _var, _require = '') {
|
||||||
vars.push(_var.slice(1))
|
vars.push(_var.slice(1))
|
||||||
if (_prefix === '/') {
|
if (_prefix === '/') {
|
||||||
_prefix = '/?'
|
_prefix = '/?'
|
||||||
|
@ -116,6 +116,7 @@ class Router {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let [k, route] of this.#tables) {
|
for (let [k, route] of this.#tables) {
|
||||||
|
console.log(route, path.match(route.regexp))
|
||||||
let args = path.match(route.regexp)
|
let args = path.match(route.regexp)
|
||||||
if (args) {
|
if (args) {
|
||||||
let params = Object.create(null)
|
let params = Object.create(null)
|
||||||
|
|
Loading…
Reference in New Issue