优化:名录编码自动生成并隐藏维护入口
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
/** Internal catalog identity never needs user input. Existing identities survive renames. */
|
||||
export function newMasterDataCode(existing: Iterable<string>): string {
|
||||
const used = existing instanceof Set ? existing : new Set(existing);
|
||||
let code: string;
|
||||
do { code = `REF-${crypto.randomUUID()}`; } while (used.has(code));
|
||||
return code;
|
||||
}
|
||||
Reference in New Issue
Block a user