UNPKG

@wordpress/url

Version:
8 lines (7 loc) 696 B
{ "version": 3, "sources": ["../src/safe-decode-uri-component.ts"], "sourcesContent": ["/**\n * Safely decodes a URI component with `decodeURIComponent`. Returns the URI component unmodified if\n * `decodeURIComponent` throws an error.\n *\n * @param uriComponent URI component to decode.\n *\n * @return Decoded URI component if possible.\n */\nexport function safeDecodeURIComponent( uriComponent: string ): string {\n\ttry {\n\t\treturn decodeURIComponent( uriComponent );\n\t} catch ( uriComponentError ) {\n\t\treturn uriComponent;\n\t}\n}\n"], "mappings": ";AAQO,SAAS,uBAAwB,cAA+B;AACtE,MAAI;AACH,WAAO,mBAAoB,YAAa;AAAA,EACzC,SAAU,mBAAoB;AAC7B,WAAO;AAAA,EACR;AACD;", "names": [] }