Files
yaak-mountain-loop/packages/plugin-runtime/src/migrations.ts
2025-11-13 05:57:11 -08:00

18 lines
424 B
TypeScript

import type { TemplateFunctionPlugin } from '@yaakapp/api';
export function migrateTemplateFunctionSelectOptions(
f: TemplateFunctionPlugin,
): TemplateFunctionPlugin {
const migratedArgs = f.args.map((a) => {
if (a.type === 'select') {
a.options = a.options.map((o) => ({
...o,
label: o.label || (o as any).name,
}));
}
return a;
});
return { ...f, args: migratedArgs };
}