/** * Function that wraps encodeURIComponent to encode additional characters * to fully adhere to RFC 3986. */ export function extendedEncodeURIComponent(str: string): string { return encodeURIComponent(str).replace(/[!'()*]/g, function (c) { return "%" + c.charCodeAt(0).toString(16).toUpperCase(); }); }