* Tries to decode the URI component without throwing an exception. * * @param str value potential URI component to check. * @returns the decoded URI if it can be decoded or else `undefined`.
(value: string)
| 245 | * @returns the decoded URI if it can be decoded or else `undefined`. |
| 246 | */ |
| 247 | function tryDecodeURIComponent(value: string): string | undefined { |
| 248 | try { |
| 249 | return decodeURIComponent(value); |
| 250 | } catch (e) { |
| 251 | // Ignore any invalid uri component. |
| 252 | return undefined; |
| 253 | } |
| 254 | } |
| 255 | |
| 256 | /** |
| 257 | * Parses an escaped url query string into key-value pairs. Logic taken from |
no outgoing calls
no test coverage detected
searching dependent graphs…