mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-29 00:05:01 +00:00
Full-featured pastebin application with: - Next.js frontend with TypeScript - Express backend with SQLite/PostgreSQL - Syntax highlighting for 100+ languages - Code quality validation system - Comprehensive accessibility (WCAG compliance) - Docker deployment configuration - Playwright E2E tests - Jest unit tests This provides a standalone web application that can be integrated as a capability module in the Universal Platform. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
29 lines
972 B
TypeScript
29 lines
972 B
TypeScript
import { InputParameter } from '@/lib/types'
|
|
|
|
export function parseInputParameters(inputParameters?: InputParameter[]): Record<string, unknown> {
|
|
if (!inputParameters || inputParameters.length === 0) {
|
|
return {}
|
|
}
|
|
|
|
const parsedProps: Record<string, unknown> = {}
|
|
|
|
inputParameters.forEach((param) => {
|
|
try {
|
|
if (param.type === 'string') {
|
|
parsedProps[param.name] = param.defaultValue.replace(/^["']|["']$/g, '')
|
|
} else if (param.type === 'number') {
|
|
parsedProps[param.name] = Number(param.defaultValue)
|
|
} else if (param.type === 'boolean') {
|
|
parsedProps[param.name] = param.defaultValue === 'true'
|
|
} else if (param.type === 'array' || param.type === 'object') {
|
|
parsedProps[param.name] = JSON.parse(param.defaultValue)
|
|
}
|
|
} catch (err) {
|
|
console.warn(`Failed to parse parameter ${param.name}:`, err)
|
|
parsedProps[param.name] = param.defaultValue
|
|
}
|
|
})
|
|
|
|
return parsedProps
|
|
}
|