mirror of
https://github.com/Instadapp/Swap-Aggregator-Subgraph.git
synced 2024-07-29 21:57:12 +00:00
18 lines
624 B
TypeScript
18 lines
624 B
TypeScript
import { encode, decode, URI_UNSAFE, URL_UNSAFE } from "./util/uri";
|
|
|
|
export function encodeURI(str: string): string {
|
|
return changetype<string>(encode(changetype<usize>(str), str.length, URI_UNSAFE));
|
|
}
|
|
|
|
export function decodeURI(str: string): string {
|
|
return changetype<string>(decode(changetype<usize>(str), str.length, false));
|
|
}
|
|
|
|
export function encodeURIComponent(str: string): string {
|
|
return changetype<string>(encode(changetype<usize>(str), str.length, URL_UNSAFE));
|
|
}
|
|
|
|
export function decodeURIComponent(str: string): string {
|
|
return changetype<string>(decode(changetype<usize>(str), str.length, true));
|
|
}
|