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

Method encodePath

packages/common/upgrade/src/params.ts:115–126  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

113export class AngularJSUrlCodec implements UrlCodec {
114 // https://github.com/angular/angular.js/blob/864c7f0/src/ng/location.js#L15
115 encodePath(path: string): string {
116 const segments = path.split('/');
117 let i = segments.length;
118
119 while (i--) {
120 // decode forward slashes to prevent them from being double encoded
121 segments[i] = encodeUriSegment(segments[i].replace(/%2F/g, '/'));
122 }
123
124 path = segments.join('/');
125 return _stripIndexHtml(((path && path[0] !== '/' && '/') || '') + path);
126 }
127
128 // https://github.com/angular/angular.js/blob/864c7f0/src/ng/location.js#L42
129 encodeSearch(search: string | {[k: string]: unknown}): string {

Callers 1

normalizeMethod · 0.95

Calls 4

encodeUriSegmentFunction · 0.70
_stripIndexHtmlFunction · 0.70
joinMethod · 0.65
replaceMethod · 0.45

Tested by

no test coverage detected