@mapl/router 0.5.6 → 0.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/path/compiler.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mapl/router",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.7",
|
|
4
4
|
"description": "The fastest possible JS router",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
"packageManager": "pnpm@10.12.1+sha512.f0dda8580f0ee9481c5c79a1d927b9164f2c478e90992ad268bbb2465a736984391d6333d2c327913578b2804af33474ca554ba29c04a8b13060a717675ae3ac",
|
|
14
14
|
"exports": {
|
|
15
15
|
"./constants": "./constants.js",
|
|
16
|
-
"./method": "./method/index.js",
|
|
17
16
|
"./method/compiler": "./method/compiler.js",
|
|
18
|
-
"./
|
|
17
|
+
"./method": "./method/index.js",
|
|
19
18
|
"./tree/compiler": "./tree/compiler.js",
|
|
19
|
+
"./path/compiler": "./path/compiler.js",
|
|
20
20
|
"./tree/node": "./tree/node.js",
|
|
21
|
-
"./path
|
|
21
|
+
"./path": "./path/index.js"
|
|
22
22
|
}
|
|
23
23
|
}
|
package/path/compiler.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{compile}from"../tree/compiler.js";export default (router,startIndex)=>{let str=``;for(let i=0,pairs=router[0];i<pairs.length;i++)str+=(str===``?`if(`:`else if(`)+`p==="`+pairs[i][0].slice(startIndex)+`"){`+pairs[i][1]+`}`;return str+(router[1]===null?``:`{let l=p.length;`+compile(router[1],0,-startIndex,``)
|
|
1
|
+
import{compile}from"../tree/compiler.js";export default (router,startIndex)=>{let str=``;for(let i=0,pairs=router[0];i<pairs.length;i++)str+=(str===``?`if(`:`else if(`)+`p==="`+pairs[i][0].slice(startIndex)+`"){`+pairs[i][1]+`}`;return str+(router[1]===null?``:`{let l=p.length;`+compile(router[1],0,-startIndex,``)+`}`)};
|