export const URL_HASH_PREFIX = '#'; export const WIX_PROTOCOL = 'wix:'; export function encodeText(text: any) { return encodeURIComponent(text); } export function alignIfLegacy(url: string, type: string): string { const { protocol } = new URL(url); return protocol === `${type}:` ? `${WIX_PROTOCOL}${url}` : url; } export function decodeText(s: string) { if (!s) { return s; } return decodeURIComponent(s); }