MCPcopy Create free account
hub / github.com/d34dman/drupal-jsonapi-params / getQueryObject

Method getQueryObject

src/index.ts:395–411  ·  view source on GitHub ↗

* Get query object. * * @category Helper

()

Source from the content-addressed store, hash-verified

393 * @category Helper
394 */
395 public getQueryObject(): ParamBag<any> {
396 const foo: ParamBag<any> = JSON.parse(JSON.stringify(this.data));
397
398 if (this.data.include.length > 0) {
399 foo.include = this.data.include.join(',');
400 } else {
401 delete foo.include;
402 }
403
404 if (this.data.sort.length > 0) {
405 foo.sort = this.data.sort.join(',');
406 } else {
407 delete foo.sort;
408 }
409
410 return foo;
411 }
412
413 /**
414 * Get query string.

Callers 1

getQueryStringMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected