@webtypen/webframez-core 0.3.17 → 0.3.19

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.
@@ -180,17 +180,17 @@ class RouterFacade {
180
180
  // Extract wildcard parameters
181
181
  let wildcardIndex = paramNames.length + 1;
182
182
  wildcards.forEach((wildcard, index) => {
183
- if (wildcard === '/**') {
184
- params['wildcard'] = match[wildcardIndex] || '';
183
+ if (wildcard === "/**") {
184
+ params["wildcard"] = match[wildcardIndex] || "";
185
185
  }
186
- else if (wildcard === '/*') {
187
- params['splat'] = match[wildcardIndex] || '';
186
+ else if (wildcard === "/*") {
187
+ params["splat"] = match[wildcardIndex] || "";
188
188
  }
189
- else if (wildcard === '**') {
190
- params['wildcard'] = match[wildcardIndex] || '';
189
+ else if (wildcard === "**") {
190
+ params["wildcard"] = match[wildcardIndex] || "";
191
191
  }
192
- else if (wildcard === '*') {
193
- params['splat'] = match[wildcardIndex] || '';
192
+ else if (wildcard === "*") {
193
+ params["splat"] = match[wildcardIndex] || "";
194
194
  }
195
195
  wildcardIndex++;
196
196
  });
@@ -215,9 +215,9 @@ class RouterFacade {
215
215
  .replace(/\/:\w+\?/g, "(?:/([^/]+))?")
216
216
  .replace(/\/:\w+/g, "/([^/]+)")
217
217
  .replace(/\/\*\*/g, "/(.*)") // Catchall wildcard: /**
218
- .replace(/\/\*/g, "/([^/]*)")
218
+ .replace(/\/\*/g, "(?:/(.*))??") // Single wildcard: /* (optional trailing content)
219
219
  .replace(/\*\*/g, "(.*)")
220
- .replace(/\*/g, "([^/]*)")
220
+ .replace(/\*/g, "(.*)")
221
221
  .replace(/\//g, "\\/") +
222
222
  "$";
223
223
  const match = url.match(regex);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webtypen/webframez-core",
3
- "version": "0.3.17",
3
+ "version": "0.3.19",
4
4
  "description": "The core package of the typescript based webframez (web-framework) by webtypen.de",
5
5
  "homepage": "https://webtypen.de/",
6
6
  "license": "MIT",
@@ -212,14 +212,14 @@ class RouterFacade {
212
212
  // Extract wildcard parameters
213
213
  let wildcardIndex = paramNames.length + 1;
214
214
  wildcards.forEach((wildcard, index) => {
215
- if (wildcard === '/**') {
216
- params['wildcard'] = match[wildcardIndex] || '';
217
- } else if (wildcard === '/*') {
218
- params['splat'] = match[wildcardIndex] || '';
219
- } else if (wildcard === '**') {
220
- params['wildcard'] = match[wildcardIndex] || '';
221
- } else if (wildcard === '*') {
222
- params['splat'] = match[wildcardIndex] || '';
215
+ if (wildcard === "/**") {
216
+ params["wildcard"] = match[wildcardIndex] || "";
217
+ } else if (wildcard === "/*") {
218
+ params["splat"] = match[wildcardIndex] || "";
219
+ } else if (wildcard === "**") {
220
+ params["wildcard"] = match[wildcardIndex] || "";
221
+ } else if (wildcard === "*") {
222
+ params["splat"] = match[wildcardIndex] || "";
223
223
  }
224
224
  wildcardIndex++;
225
225
  });
@@ -245,10 +245,10 @@ class RouterFacade {
245
245
  routeObj.path
246
246
  .replace(/\/:\w+\?/g, "(?:/([^/]+))?")
247
247
  .replace(/\/:\w+/g, "/([^/]+)")
248
- .replace(/\/\*\*/g, "/(.*)") // Catchall wildcard: /**
249
- .replace(/\/\*/g, "/([^/]*)")
248
+ .replace(/\/\*\*/g, "/(.*)") // Catchall wildcard: /**
249
+ .replace(/\/\*/g, "(?:/(.*))??") // Single wildcard: /* (optional trailing content)
250
250
  .replace(/\*\*/g, "(.*)")
251
- .replace(/\*/g, "([^/]*)")
251
+ .replace(/\*/g, "(.*)")
252
252
  .replace(/\//g, "\\/") +
253
253
  "$";
254
254
  const match = url.match(regex);