elysia 0.2.2 → 0.2.3
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/dist/index.js +4 -7
- package/dist/types.d.ts +0 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -35,7 +35,6 @@ export default class Elysia {
|
|
|
35
35
|
await this.event.stop[i](this);
|
|
36
36
|
};
|
|
37
37
|
this.config = {
|
|
38
|
-
strictPath: false,
|
|
39
38
|
...config
|
|
40
39
|
};
|
|
41
40
|
}
|
|
@@ -81,11 +80,6 @@ export default class Elysia {
|
|
|
81
80
|
validator
|
|
82
81
|
};
|
|
83
82
|
this.router.add(method, path, mainHandler);
|
|
84
|
-
if (!this.config.strictPath && path !== '/')
|
|
85
|
-
if (path.endsWith('/'))
|
|
86
|
-
this.router.add(method, path.substring(0, path.length - 1), mainHandler);
|
|
87
|
-
else
|
|
88
|
-
this.router.add(method, `${path}/`, mainHandler);
|
|
89
83
|
}
|
|
90
84
|
onStart(handler) {
|
|
91
85
|
this.event.start.push(handler);
|
|
@@ -158,7 +152,10 @@ export default class Elysia {
|
|
|
158
152
|
...sandbox.event.request
|
|
159
153
|
];
|
|
160
154
|
Object.values(instance.routes).forEach(({ method, path, handler, hooks }) => {
|
|
161
|
-
|
|
155
|
+
if (path === '/')
|
|
156
|
+
this._addHandler(method, prefix, handler, hooks);
|
|
157
|
+
else
|
|
158
|
+
this._addHandler(method, `${prefix}${path}`, handler, hooks);
|
|
162
159
|
});
|
|
163
160
|
return this;
|
|
164
161
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -172,7 +172,6 @@ export type ComposedHandler = {
|
|
|
172
172
|
validator?: SchemaValidator;
|
|
173
173
|
};
|
|
174
174
|
export interface ElysiaConfig {
|
|
175
|
-
strictPath: boolean;
|
|
176
175
|
serve?: Partial<Serve>;
|
|
177
176
|
}
|
|
178
177
|
export type IsPathParameter<Part> = Part extends `:${infer Parameter}` ? Parameter : never;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "elysia",
|
|
3
3
|
"description": "Fast, and friendly Bun web framework",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.3",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "saltyAom",
|
|
7
7
|
"url": "https://github.com/SaltyAom",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@sinclair/typebox": "^0.25.21",
|
|
39
39
|
"openapi-types": "^12.1.0",
|
|
40
|
-
"raikiri": "0.0.0-beta.
|
|
40
|
+
"raikiri": "0.0.0-beta.4"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/node": "^18.11.18",
|