MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / parseJsonArray

Function parseJsonArray

dashboard/lcm/src/helpers.ts:70–79  ·  view source on GitHub ↗
(value: any)

Source from the content-addressed store, hash-verified

68}
69
70export function parseJsonArray(value: any): any[] {
71 if (Array.isArray(value)) return value;
72 if (typeof value !== "string" || !value.trim()) return [];
73 try {
74 const parsed = JSON.parse(value);
75 return Array.isArray(parsed) ? parsed : [];
76 } catch (e) {
77 return [];
78 }
79}
80
81export function copyTextValue(text: any): Promise<boolean> {
82 const value = String(text == null ? "" : text);

Callers 2

MessageDetailFunction · 0.90
NodeDetailFunction · 0.90

Calls 1

parseMethod · 0.45

Tested by

no test coverage detected