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

Method decodePath

packages/common/upgrade/src/params.ts:145–158  ·  view source on GitHub ↗
(path: string, html5Mode = true)

Source from the content-addressed store, hash-verified

143
144 // https://github.com/angular/angular.js/blob/864c7f0/src/ng/location.js#L27
145 decodePath(path: string, html5Mode = true): string {
146 const segments = path.split('/');
147 let i = segments.length;
148
149 while (i--) {
150 segments[i] = decodeURIComponent(segments[i]);
151 if (html5Mode) {
152 // encode forward slashes to prevent them from being mistaken for path separators
153 segments[i] = segments[i].replace(/\//g, '%2F');
154 }
155 }
156
157 return segments.join('/');
158 }
159
160 // https://github.com/angular/angular.js/blob/864c7f0/src/ng/location.js#L72
161 decodeSearch(search: string) {

Callers 3

normalizeMethod · 0.95
parseAppUrlMethod · 0.80
urlMethod · 0.80

Calls 2

joinMethod · 0.65
replaceMethod · 0.45

Tested by

no test coverage detected