bajo 1.2.0 → 1.2.2

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.
@@ -106,11 +106,31 @@ class BajoCore extends Plugin {
106
106
  }
107
107
  if (!this.app[ns]) throw this.error('unknownPluginOrNotLoaded%s')
108
108
  }
109
- const fullPath = path
110
109
  let qs
111
110
  [path, qs] = path.split('?')
112
111
  qs = querystring.parse(qs) ?? {}
113
- return { ns, path, subNs, subSubNs, qs, fullPath, fullNs }
112
+ // normalize path
113
+ const parts = path.split('/')
114
+ const realParts = []
115
+ const params = {}
116
+ for (const idx in parts) {
117
+ const part = parts[idx]
118
+ if (part[0] !== ':' || part.indexOf('|') === -1) {
119
+ realParts.push(part)
120
+ continue
121
+ }
122
+ const [key, val] = part.split('|')
123
+ parts[idx] = key
124
+ params[key.slice(1)] = val
125
+ realParts.push(val)
126
+ }
127
+ path = parts.join('/')
128
+ const realPath = realParts.join('/')
129
+ let fullPath = path
130
+ if (!isEmpty(qs)) fullPath += ('?' + querystring.stringify(qs, null, null, { encodeURIComponent: (text) => (text) }))
131
+ let realFullPath = realPath
132
+ if (!isEmpty(qs)) realFullPath += ('?' + querystring.stringify(qs, null, null, { encodeURIComponent: (text) => (text) }))
133
+ return { ns, path, subNs, subSubNs, qs, fullPath, fullNs, realPath, realFullPath }
114
134
  }
115
135
 
116
136
  buildCollections = async (options = {}) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bajo",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "A framework to build a giant monstrous app rapidly",
5
5
  "main": "boot/index.js",
6
6
  "scripts": {