MCPcopy Create free account
hub / github.com/driangle/taskmd / checkArrayFields

Function checkArrayFields

apps/vscode/src/validate.ts:103–124  ·  view source on GitHub ↗
(
  fm: ParsedFrontmatter,
  issues: ValidationIssue[]
)

Source from the content-addressed store, hash-verified

101}
102
103function checkArrayFields(
104 fm: ParsedFrontmatter,
105 issues: ValidationIssue[]
106): void {
107 for (const name of STRING_ARRAY_FIELDS) {
108 const field = fm.fields.get(name);
109 if (!field) continue;
110
111 const val = field.value;
112 // null/undefined means field present but no value, which is fine (treated as empty array)
113 if (val === null || val === undefined) continue;
114
115 if (!Array.isArray(val)) {
116 issues.push({
117 severity: "error",
118 message: `'${name}' should be an array, got ${typeof val}`,
119 field: name,
120 target: "value",
121 });
122 }
123 }
124}
125
126function checkDateFields(
127 fm: ParsedFrontmatter,

Callers 1

validateFunction · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected