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

Function retrieveSeldonParamsFromURL

client/js-client/src/rlClient.js:39–66  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

37 }
38
39 function retrieveSeldonParamsFromURL() {
40 var normalised = params.current_page_url,
41 retVal,
42 rlabs,
43 query_params,
44 query = normalised.replace(new RegExp(".*\\" + params.rlabs_delim), "");
45 if (params.rlabs_delim === "?") {
46 // removing final # if present in the query parameter
47 query = query.replace(new RegExp("#" + ".*"), "");
48 }
49
50 //// Fix for actual spaces appearing in the query string, eg "rlabs=3 rt$sitewide p$8"
51 /// convert these to %20 eg. "rlabs=3%20rt$sitewide%20p$8"
52 query = query.split(' ').join('%20');
53 ////
54
55 if (query !== "") {
56 query_params = extractQuery(query);
57 underscore.each(params.track_par_list, function (par) {
58 var val = query_params[par];
59 if (val) {
60 rlabs = val;
61 }
62 });
63 }
64 retVal = rlabs ? rlabs.split("%20") : [];
65 return retVal;
66 }
67
68 function extractExtraSeldonParams(param_list) {
69 var i, retVal = {};

Callers 2

addActionFunction · 0.85
recommendationsForFunction · 0.85

Calls 2

extractQueryFunction · 0.85
joinMethod · 0.45

Tested by

no test coverage detected