UNPKG
lean4-code-actions
Version:
latest (1.1.32)
1.1.32
Refactorings and snippets for Lean 4
lean4-code-actions
/
libs
/
generic
/
models
/
Name
/
withIdFromName.ts
10 lines
(8 loc)
•
211 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
import
{ fromStringToId }
from
'../Id'
import
{ Name }
from
'../Name'
export function withIdFromName<Obj>($
object
: Obj & { name: Name }) {
return
{ ...$
object
,
id
: fromStringToId($
object
.name), } }