216d72b5d7
Co-authored-by: Félix Malfait <felix@twenty.com>
10 lines
217 B
TypeScript
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;
|
|
}
|
|
};
|