UNPKG

lean4-code-actions

Version:

Refactorings and snippets for Lean 4

10 lines (8 loc) 211 B
import { fromStringToId } from '../Id' import { Name } from '../Name' export function withIdFromName<Obj>($object: Obj & { name: Name }) { return { ...$object, id: fromStringToId($object.name), } }