@fusedashlabs/ui9000-workspace
Version:
UI9000 workspace MCP. One tool, show_workspace, draws a chart from your table. Set TYPESAFE_API_KEY to let Jev choose the chart.
19 lines (18 loc) • 496 B
JavaScript
export function bindFieldMap(binds) {
const out = {};
if (!binds)
return out;
if (Array.isArray(binds)) {
for (const item of binds) {
if (item?.role && item.field)
out[item.role] = item.field;
}
return out;
}
for (const [role, value] of Object.entries(binds)) {
const field = typeof value === 'string' ? value : value?.field;
if (role && field)
out[role] = field;
}
return out;
}