Files
twenty/packages/twenty-shared/src/ai/utils/parseStreamLine.ts
T
Abdul Rahman 216d72b5d7 AI SDK v5 migration (#14549)
Co-authored-by: Félix Malfait <felix@twenty.com>
2025-09-22 22:13:43 +02:00

10 lines
217 B
TypeScript

import type { StreamEvent } from '../types/StreamEvent';
export const parseStreamLine = (line: string): StreamEvent | null => {
try {
return JSON.parse(line) as StreamEvent;
} catch {
return null;
}
};