Update func.ts

This commit is contained in:
Zyronon
2025-09-15 15:24:56 +08:00
committed by GitHub
parent 81b5e897c1
commit 50a417c9d6

View File

@@ -6,6 +6,7 @@ import {nanoid} from "nanoid";
export function getDefaultWord(val: Partial<Word> = {}): Word {
return {
custom: false,
id : nanoid(6),
"word": "",
"phonetic0": "",
"phonetic1": "",
@@ -18,8 +19,7 @@ export function getDefaultWord(val: Partial<Word> = {}): Word {
"rels": []
},
"etymology": [],
...val,
id: val?.id ? val.id : nanoid(6),
...val
}
}