MCPcopy
hub / github.com/buxuku/SmartSub / formatValueForInput

Function formatValueForInput

renderer/lib/parameterValueUtils.ts:72–85  ·  view source on GitHub ↗
(
  value: ParameterValue,
  type: ParameterType,
)

Source from the content-addressed store, hash-verified

70}
71
72export function formatValueForInput(
73 value: ParameterValue,
74 type: ParameterType,
75): string {
76 if (type === 'array') {
77 try {
78 return JSON.stringify(value);
79 } catch {
80 return '[]';
81 }
82 }
83 if (type === 'boolean') return String(value);
84 return String(value ?? '');
85}

Callers 3

CustomParameterEditorFunction · 0.90
ValueEditorFunction · 0.90
ExistingValueCellFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected