MCPcopy Create free account
hub / github.com/apache/cloudstack / interpolate

Function interpolate

tools/ngui/static/js/lib/angular.js:7495–7509  ·  view source on GitHub ↗

* @returns interpolation of the redirect path with the parametrs

(string, params)

Source from the content-addressed store, hash-verified

7493 * @returns interpolation of the redirect path with the parametrs
7494 */
7495 function interpolate(string, params) {
7496 var result = [];
7497 forEach((string||'').split(':'), function(segment, i) {
7498 if (i == 0) {
7499 result.push(segment);
7500 } else {
7501 var segmentMatch = segment.match(/(\w+)(.*)/);
7502 var key = segmentMatch[1];
7503 result.push(params[key]);
7504 result.push(segmentMatch[2] || '');
7505 delete params[key];
7506 }
7507 });
7508 return result.join('');
7509 }
7510 }];
7511}
7512

Callers 1

updateRouteFunction · 0.85

Calls 3

forEachFunction · 0.85
matchMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected