MCPcopy Index your code
hub / github.com/angular/angular / tryDecodeURIComponent

Function tryDecodeURIComponent

packages/common/upgrade/src/params.ts:247–254  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

245 * @returns the decoded URI if it can be decoded or else `undefined`.
246 */
247function 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

Callers 1

parseKeyValueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…