Skip to content

Commit 3ab2d0b

Browse files
ANKUR DWIVEDIANKUR DWIVEDI
authored andcommitted
foramtted the code
1 parent feea5ab commit 3ab2d0b

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

libs/url/builder.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,8 @@ const hasMoreThanAscii = (str: string) => {
2929
return str.split('').some((char) => char.charCodeAt(0) > 127);
3030
}
3131

32-
const customEncodeURIComponent = (str: string) => {
33-
const url = new URL(str);
34-
return url.toString();
35-
};
36-
3732
export const encodeStringIfRequired = (str: string) => {
38-
return hasMoreThanAscii(str) ? customEncodeURIComponent(str) : str;
33+
return hasMoreThanAscii(str) ? new URL(str).toString() : str;
3934
}
4035

4136
const buildURL = function (opts: FinalUrlOptions): string {

0 commit comments

Comments
 (0)