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

Function normalizeValue

static/js/utils.js:489–508  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

487
488const filterProtocol = {
489 normalizeValue(value) {
490 if (value === null || value === undefined) return null;
491 if (typeof value === 'string') {
492 const trimmed = value.trim();
493 return trimmed ? trimmed : null;
494 }
495 if (typeof value === 'number') {
496 return Number.isFinite(value) ? value : null;
497 }
498 if (typeof value === 'boolean') {
499 return value;
500 }
501 if (Array.isArray(value)) {
502 const normalized = value
503 .map((item) => this.normalizeValue(item))
504 .filter((item) => item !== null);
505 return normalized.length ? normalized : null;
506 }
507 return value;
508 },
509
510 normalize(filters = {}) {
511 const result = {};

Callers

nothing calls this directly

Calls 1

filterMethod · 0.45

Tested by

no test coverage detected