MCPcopy Create free account
hub / github.com/ConardLi/easy-agent / asStringArray

Function asStringArray

step/step17.js:59–69  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

57}
58
59function asStringArray(value) {
60 if (Array.isArray(value)) {
61 return value
62 .map((item) => (typeof item === "string" ? item.trim() : undefined))
63 .filter(Boolean);
64 }
65 if (typeof value === "string") {
66 return value.split(",").map((item) => item.trim()).filter(Boolean);
67 }
68 return [];
69}
70
71function asBoolean(value) {
72 if (typeof value === "boolean") return value;

Callers 1

normalizeFrontmatterFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected