We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent feea5ab commit 3ab2d0bCopy full SHA for 3ab2d0b
libs/url/builder.ts
@@ -29,13 +29,8 @@ const hasMoreThanAscii = (str: string) => {
29
return str.split('').some((char) => char.charCodeAt(0) > 127);
30
}
31
32
-const customEncodeURIComponent = (str: string) => {
33
- const url = new URL(str);
34
- return url.toString();
35
-};
36
-
37
export const encodeStringIfRequired = (str: string) => {
38
- return hasMoreThanAscii(str) ? customEncodeURIComponent(str) : str;
+ return hasMoreThanAscii(str) ? new URL(str).toString() : str;
39
40
41
const buildURL = function (opts: FinalUrlOptions): string {
0 commit comments