bun-plugin-stx 0.2.150 → 0.2.151

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.
Files changed (2) hide show
  1. package/dist/serve.js +2 -2
  2. package/package.json +1 -1
package/dist/serve.js CHANGED
@@ -8757,7 +8757,7 @@ function extractServerScriptsFromTemplate(content) {
8757
8757
  return { serverScripts, templateContent: retained.join("") };
8758
8758
  }
8759
8759
  function buildDynamicRouteRegexes(fileRouteBase) {
8760
- const toPattern = (p) => p.replace(/\[([^\]]+)\]/g, "([^/]+)").replace(/\//g, "\\/");
8760
+ const toPattern = (p) => p.replace(/\[\.\.\.([^\]]+)\]/g, "(.+)").replace(/\[([^\]]+)\]/g, "([^/]+)").replace(/\//g, "\\/");
8761
8761
  const patterns = [new RegExp(`^${toPattern(fileRouteBase)}$`)];
8762
8762
  const noIndex = fileRouteBase.replace(/\/index$/, "");
8763
8763
  if (noIndex !== fileRouteBase)
@@ -9708,7 +9708,7 @@ After installing: bun add bun-plugin-stx`);
9708
9708
  for (const regex of regexPatterns) {
9709
9709
  const match = normalizedPath.match(regex);
9710
9710
  if (match) {
9711
- const paramNames = [...fileRouteBase.matchAll(/\[([^\]]+)\]/g)].map((m) => m[1]);
9711
+ const paramNames = [...fileRouteBase.matchAll(/\[([^\]]+)\]/g)].map((m) => m[1].replace(/^\.\.\./, ""));
9712
9712
  const paramValues = match.slice(1);
9713
9713
  const output = await processTemplateDynamic(filePath, paramNames, paramValues, normalizedPath, reqCtx);
9714
9714
  routes.set(requestPath, output);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bun-plugin-stx",
3
3
  "type": "module",
4
- "version": "0.2.150",
4
+ "version": "0.2.151",
5
5
  "description": "A Bun plugin that allows for using Laravel Blade-like syntax.",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",
7
7
  "license": "MIT",