2 lines
165 B
JavaScript
2 lines
165 B
JavaScript
export const escapeUri = (uri) => encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode);
|
|
const hexEncode = (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`;
|