4.8.5 test (#1825)

* update model logo

* perf: hide list clb api
This commit is contained in:
Archer
2024-06-24 09:29:54 +08:00
committed by GitHub
parent 24596a6e21
commit a9ab9ebe8e
10 changed files with 133 additions and 85 deletions

View File

@@ -67,6 +67,14 @@ export const getNanoid = (size = 12) => {
/* Custom text to reg, need to replace special chats */
export const replaceRegChars = (text: string) => text.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
export const getRegQueryStr = (text: string, flags = 'i') => {
const formatText = replaceRegChars(text);
const chars = formatText.split('');
const regexPattern = chars.join('.*');
return new RegExp(regexPattern, flags);
};
/* slice json str */
export const sliceJsonStr = (str: string) => {
str = str.replace(/(\\n|\\)/g, '').replace(/ /g, '');