MCPcopy Create free account
hub / github.com/Tron521/codex-console-temp / toQuery

Function toQuery

static/js/utils.js:520–533  ·  view source on GitHub ↗
(filters = {}, mapping = {})

Source from the content-addressed store, hash-verified

518 },
519
520 toQuery(filters = {}, mapping = {}) {
521 const normalized = this.normalize(filters);
522 const params = new URLSearchParams();
523 Object.entries(normalized).forEach(([key, value]) => {
524 const targetKey = String(mapping[key] || key);
525 if (!targetKey) return;
526 if (Array.isArray(value)) {
527 value.forEach((item) => params.append(targetKey, String(item)));
528 return;
529 }
530 params.set(targetKey, String(value));
531 });
532 return params;
533 },
534
535 toPayload(filters = {}, mapping = {}) {
536 const normalized = this.normalize(filters);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected