MCPcopy Create free account
hub / github.com/ParallelTask/dinoloop / getQueryParams

Method getQueryParams

src/modules/core/dino.controller.ts:32–49  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

30 // gets query string object and maps the value with corresponding key
31 // for (@QueryParam() id) returns { id: 45 }
32 getQueryParams(): any {
33 let queryParams =
34 this.controllerAction
35 .actionAttributes
36 .actionArguments
37 .map(x => x.isQueryParam ? x.key : null)
38 .filter(x => !DataUtility.isNull(x));
39
40 let queryString = {};
41
42 for (const queryParam of queryParams) {
43 // create new object, key = value
44 queryString[queryParam] =
45 this.controller.request.query[queryParam];
46 }
47
48 return queryString;
49 }
50
51 // made public for unit-test, not available on contract
52 // maps url-segments and query-strings

Callers 2

mapSegmentsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected