@server/next 0.27.6 → 0.27.8
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/index.d.ts +10 -1
- package/index.js +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -2,6 +2,15 @@ type Method = "get" | "post" | "put" | "patch" | "delete" | "head" | "options" |
|
|
|
2
2
|
type ServerConfig = {
|
|
3
3
|
User?: Record<string, string | number | boolean | Date | null | undefined>;
|
|
4
4
|
};
|
|
5
|
+
declare namespace JSX {
|
|
6
|
+
interface Element {
|
|
7
|
+
type: any;
|
|
8
|
+
props: any;
|
|
9
|
+
}
|
|
10
|
+
interface IntrinsicElements {
|
|
11
|
+
[elem: string]: any;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
5
14
|
type RouteOptions = {
|
|
6
15
|
tags?: string | string[];
|
|
7
16
|
title?: string;
|
|
@@ -162,7 +171,7 @@ type Context<Params extends Record<string, string> = Record<string, string>, O e
|
|
|
162
171
|
type InlineReply = Response | {
|
|
163
172
|
body: string;
|
|
164
173
|
headers?: Headers;
|
|
165
|
-
} | SerializableValue;
|
|
174
|
+
} | SerializableValue | JSX.Element;
|
|
166
175
|
type Body = InlineReply;
|
|
167
176
|
type Middleware<O extends ServerConfig = object, Params extends Record<string, string> = Record<string, string>> = (ctx: Context<Params, O>) => InlineReply | Promise<InlineReply> | void | Promise<void>;
|
|
168
177
|
|
package/index.js
CHANGED
|
@@ -860,7 +860,7 @@ function pathPattern(pattern, path2) {
|
|
|
860
860
|
path2 = path2.replace(/\/$/, "") || "/";
|
|
861
861
|
if (pattern === path2) return {};
|
|
862
862
|
const params = {};
|
|
863
|
-
const pathParts = path2.split("/").slice(1);
|
|
863
|
+
const pathParts = path2.split("/").slice(1).map((u) => decodeURIComponent(u));
|
|
864
864
|
const pattParts = pattern.split("/").slice(1);
|
|
865
865
|
let allSame = true;
|
|
866
866
|
for (let i = 0; i < Math.max(pathParts.length, pattParts.length); i++) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@server/next",
|
|
3
|
-
"version": "0.27.
|
|
3
|
+
"version": "0.27.8",
|
|
4
4
|
"description": "A fully-fledged web server with routing, file uploads, sessions, static files, schema validation, websockets, testing, etc.",
|
|
5
5
|
"homepage": "https://server-js.com/",
|
|
6
6
|
"repository": "https://github.com/franciscop/server-next.git",
|