feat: scaffold yonexus MVP core with storage, auth, query, and scope memory
This commit is contained in:
10
src/utils/id.ts
Normal file
10
src/utils/id.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
const SAFE = /[^a-z0-9]+/g;
|
||||
|
||||
export function slug(input: string): string {
|
||||
return input.trim().toLowerCase().replace(SAFE, "-").replace(/^-+|-+$/g, "");
|
||||
}
|
||||
|
||||
export function makeId(prefix: string, input: string): string {
|
||||
const s = slug(input);
|
||||
return `${prefix}:${s || "unknown"}`;
|
||||
}
|
||||
Reference in New Issue
Block a user