MCPcopy Create free account
hub / github.com/ScaleML/AgentSPEX / parseYamlParams

Function parseYamlParams

yaml-flow-editor/src/components/NodeConfigPanel.tsx:34–50  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

32
33// Helper to parse YAML string to object
34const parseYamlParams = (str: string): Record<string, unknown> | null => {
35 if (!str.trim()) return {};
36 try {
37 const parsed = yaml.load(str);
38 if (typeof parsed === 'object' && parsed !== null) {
39 // Convert null values to empty strings to preserve keys
40 const result: Record<string, unknown> = {};
41 for (const [key, value] of Object.entries(parsed as Record<string, unknown>)) {
42 result[key] = value === null || value === undefined ? '' : value;
43 }
44 return result;
45 }
46 return null;
47 } catch {
48 return null;
49 }
50};
51
52// YAML Parameters Editor with local state for smooth editing
53function YamlParamsEditor({

Callers 3

YamlParamsEditorFunction · 0.70
renderGatherCallsFunction · 0.70
updateParamsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected