mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-05-18 13:47:08 +02:00
Split codebase (#455)
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import { generateId } from "../../lib/generateId";
|
||||
import type { Pair, PairWithId } from "./PairEditor";
|
||||
|
||||
export function ensurePairId(p: Pair): PairWithId {
|
||||
if (typeof p.id === "string") {
|
||||
return p as PairWithId;
|
||||
}
|
||||
return { ...p, id: p.id ?? generateId() };
|
||||
}
|
||||
Reference in New Issue
Block a user