mirror of
https://github.com/docmost/docmost.git
synced 2026-08-28 17:27:06 +08:00
feat(base): add prefixed nanoid id schemas and generators
This commit is contained in:
@@ -6,3 +6,8 @@ export const nanoIdGen = customAlphabet(alphabet, 10);
|
|||||||
const slugIdAlphabet =
|
const slugIdAlphabet =
|
||||||
'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
||||||
export const generateSlugId = customAlphabet(slugIdAlphabet, 10);
|
export const generateSlugId = customAlphabet(slugIdAlphabet, 10);
|
||||||
|
|
||||||
|
const baseIdSuffix = customAlphabet(alphabet, 9);
|
||||||
|
|
||||||
|
export const generateBasePropertyId = (): string => `prp${baseIdSuffix()}`;
|
||||||
|
export const generateBaseChoiceId = (): string => `opt${baseIdSuffix()}`;
|
||||||
|
|||||||
+1
-1
Submodule apps/server/src/ee updated: 3587fa638b...52a53ac537
Reference in New Issue
Block a user