hono 4.9.1 → 4.9.2
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/cjs/client/utils.js
CHANGED
|
@@ -66,11 +66,11 @@ const replaceUrlProtocol = (urlString, protocol) => {
|
|
|
66
66
|
return urlString.replace(/^ws/, "http");
|
|
67
67
|
}
|
|
68
68
|
};
|
|
69
|
-
const removeIndexString = (
|
|
70
|
-
if (/^https?:\/\/[^\/]+?\/index
|
|
71
|
-
return
|
|
69
|
+
const removeIndexString = (urlString) => {
|
|
70
|
+
if (/^https?:\/\/[^\/]+?\/index(?=\?|$)/.test(urlString)) {
|
|
71
|
+
return urlString.replace(/\/index(?=\?|$)/, "/");
|
|
72
72
|
}
|
|
73
|
-
return
|
|
73
|
+
return urlString.replace(/\/index(?=\?|$)/, "");
|
|
74
74
|
};
|
|
75
75
|
function isObject(item) {
|
|
76
76
|
return typeof item === "object" && item !== null && !Array.isArray(item);
|
package/dist/client/utils.js
CHANGED
|
@@ -37,11 +37,11 @@ var replaceUrlProtocol = (urlString, protocol) => {
|
|
|
37
37
|
return urlString.replace(/^ws/, "http");
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
|
-
var removeIndexString = (
|
|
41
|
-
if (/^https?:\/\/[^\/]+?\/index
|
|
42
|
-
return
|
|
40
|
+
var removeIndexString = (urlString) => {
|
|
41
|
+
if (/^https?:\/\/[^\/]+?\/index(?=\?|$)/.test(urlString)) {
|
|
42
|
+
return urlString.replace(/\/index(?=\?|$)/, "/");
|
|
43
43
|
}
|
|
44
|
-
return
|
|
44
|
+
return urlString.replace(/\/index(?=\?|$)/, "");
|
|
45
45
|
};
|
|
46
46
|
function isObject(item) {
|
|
47
47
|
return typeof item === "object" && item !== null && !Array.isArray(item);
|
|
@@ -6,7 +6,7 @@ export declare const mergePath: (base: string, path: string) => string;
|
|
|
6
6
|
export declare const replaceUrlParam: (urlString: string, params: Record<string, string | undefined>) => string;
|
|
7
7
|
export declare const buildSearchParams: (query: Record<string, string | string[]>) => URLSearchParams;
|
|
8
8
|
export declare const replaceUrlProtocol: (urlString: string, protocol: "ws" | "http") => string;
|
|
9
|
-
export declare const removeIndexString: (
|
|
9
|
+
export declare const removeIndexString: (urlString: string) => string;
|
|
10
10
|
export declare function deepMerge<T>(target: T, source: Record<string, unknown>): T;
|
|
11
11
|
/**
|
|
12
12
|
* Shortcut to get a consumable response from `hc`'s fetch calls (Response), with types inference.
|
|
@@ -148,7 +148,7 @@ export declare namespace JSX {
|
|
|
148
148
|
autocapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined;
|
|
149
149
|
autofocus?: boolean | undefined;
|
|
150
150
|
class?: string | Promise<string> | undefined;
|
|
151
|
-
contenteditable?: boolean | "inherit" | undefined;
|
|
151
|
+
contenteditable?: boolean | "inherit" | "plaintext-only" | undefined;
|
|
152
152
|
contextmenu?: string | undefined;
|
|
153
153
|
dir?: string | undefined;
|
|
154
154
|
draggable?: "true" | "false" | boolean | undefined;
|