elysia-autoload 0.1.6 → 0.1.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.
Files changed (2) hide show
  1. package/dist/index.js +2 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -73,7 +73,8 @@ async function autoload({ pattern, dir, prefix, schema, types, } = {}) {
73
73
  ` export type ${types === true || !types.typeName
74
74
  ? TYPES_TYPENAME_DEFAULT
75
75
  : types.typeName} = ${paths
76
- .map((x, index) => `ElysiaWithBaseUrl<"${(0, utils_1.transformToUrl)(x) || "/"}", ReturnType<typeof Route${index}>>`)
76
+ .map((x, index) => `ElysiaWithBaseUrl<"${((prefix?.endsWith("/") ? prefix.slice(0, -1) : prefix) ??
77
+ "") + (0, utils_1.transformToUrl)(x) || "/"}", ReturnType<typeof Route${index}>>`)
77
78
  .join("\n & ")}`,
78
79
  types === true || !types.useExport ? "}" : "",
79
80
  ].join("\n"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "elysia-autoload",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "author": "kravetsone",
5
5
  "type": "commonjs",
6
6
  "main": "dist/index.js",