mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-25 06:14:06 +00:00
4.6.7 first pr (#726)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import crypto from 'crypto';
|
||||
import { customAlphabet } from 'nanoid';
|
||||
|
||||
/* check string is a web link */
|
||||
export function strIsLink(str?: string) {
|
||||
@@ -36,3 +37,7 @@ export function replaceVariable(text: string, obj: Record<string, string | numbe
|
||||
}
|
||||
return text || '';
|
||||
}
|
||||
|
||||
export const getNanoid = (size = 12) => {
|
||||
return customAlphabet('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890', size)();
|
||||
};
|
||||
|
Reference in New Issue
Block a user