MCPcopy Create free account
hub / github.com/weaveworks/scope / buildUrlQuery

Function buildUrlQuery

client/app/scripts/utils/web-api-utils.js:35–49  ·  view source on GitHub ↗
(params = makeMap(), state = null)

Source from the content-addressed store, hash-verified

33})();
34
35export function buildUrlQuery(params = makeMap(), state = null) {
36 // Attach the time travel timestamp to every request to the backend.
37 if (state) {
38 params = params.set('timestamp', state.get('pausedAt'));
39 }
40
41 // Ignore the entries with values `null` or `undefined`.
42 return params.map((value, param) => {
43 if (value === undefined || value === null) return null;
44 if (List.isList(value)) {
45 value = value.join(',');
46 }
47 return `${param}=${value}`;
48 }).filter(s => s).join('&');
49}
50
51export function basePath(urlPath) {
52 //

Callers 7

getReportUrlFunction · 0.85
topologiesUrlFunction · 0.85
buildWebsocketUrlFunction · 0.85
getNodesForTopologiesFunction · 0.85
getNodesOnceFunction · 0.85
getNodeDetailsFunction · 0.85

Calls 2

filterMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…