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

Method formatYamlValue

src/services/ICSNoteService.ts:698–715  ·  view source on GitHub ↗

* Format a value for YAML frontmatter

(value: unknown)

Source from the content-addressed store, hash-verified

696 * Format a value for YAML frontmatter
697 */
698 private formatYamlValue(value: unknown): string {
699 if (typeof value === "string") {
700 // Simple check for strings that need quoting
701 if (
702 value.includes(":") ||
703 value.includes("#") ||
704 value.includes("[") ||
705 value.includes("{")
706 ) {
707 return `"${value.replace(/"/g, '\\"')}"`;
708 }
709 return value;
710 }
711 if (Array.isArray(value)) {
712 return `[${value.map((v) => (typeof v === "string" ? `"${v}"` : v)).join(", ")}]`;
713 }
714 return String(value);
715 }
716
717 /**
718 * Calculate event duration in minutes

Callers 1

createNoteFromICSMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected