diff --git a/web/src/utils/pipeline-operator.ts b/web/src/utils/pipeline-operator.ts index ceabc7d5a5..64abcee560 100644 --- a/web/src/utils/pipeline-operator.ts +++ b/web/src/utils/pipeline-operator.ts @@ -29,10 +29,17 @@ export function transformParserConfigSetups( } return Object.entries(setups) - .map(([fileFormat, config]) => ({ - fileFormat, - ...config, - })) + .map(([fileFormat, config]) => { + const { pages, ...rest } = (config ?? {}) as Record; + const normalizedPages = Array.isArray(pages) + ? pages.map(([from, to]: [number, number]) => ({ from, to })) + : pages; + return { + fileFormat, + ...rest, + ...(normalizedPages !== undefined ? { pages: normalizedPages } : {}), + } as Record; + }) .sort((a, b) => (a.order_index ?? Infinity) - (b.order_index ?? Infinity)); }