MCPcopy Create free account
hub / github.com/SeldonIO/seldon-server / rewrite

Function rewrite

client/js-client/src/rlClient.js:95–107  ·  view source on GitHub ↗
(url, rules)

Source from the content-addressed store, hash-verified

93 }
94
95 function rewrite(url, rules) {
96 var rewritten = url;
97 underscore.each(rules, function (rule) {
98 underscore.each(rule, function (focus) {
99 var focusRx = new RegExp(focus);
100 if (url.match(focusRx)) {
101 rewritten = rewritten.replace(focusRx, rule[focus]);
102 }
103 });
104 });
105
106 return rewritten;
107 }
108
109 function normalise(input) {
110 var normalised, delim = "#";

Callers 1

normaliseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected