Round-trip tests against Firecrawl, Runable, RevisionDojo, and OnePREP plan data proving diffPlanV1 + applyDiff reconstructs variants correctly. Co-authored-by: Cursor <cursoragent@cursor.com>
6 lines
200 B
TypeScript
6 lines
200 B
TypeScript
export const findById = <T extends { id: string }>(items: T[], id: string): T => {
|
|
const item = items.find((p) => p.id === id);
|
|
if (!item) throw new Error(`Item not found: ${id}`);
|
|
return item;
|
|
};
|