MCPcopy Index your code
hub / github.com/callumalpass/tasknotes / normalizeStringValues

Method normalizeStringValues

src/utils/TaskManager.ts:563–579  ·  view source on GitHub ↗
(value: unknown, includeScalar: boolean)

Source from the content-addressed store, hash-verified

561 }
562
563 private normalizeStringValues(value: unknown, includeScalar: boolean): string[] {
564 const values = Array.isArray(value) ? value : includeScalar && value ? [value] : [];
565 const normalized = new Set<string>();
566
567 for (const item of values) {
568 if (typeof item !== "string") {
569 continue;
570 }
571
572 const trimmed = item.trim();
573 if (trimmed) {
574 normalized.add(trimmed);
575 }
576 }
577
578 return Array.from(normalized).sort();
579 }
580
581 private addFilterIndexEntry(entry: TaskFilterIndexEntry): void {
582 this.taskFilterEntries.set(entry.path, entry);

Calls

no outgoing calls

Tested by

no test coverage detected