feat: 暂存添加ai chat and prompt generate

This commit is contained in:
2024-09-26 01:18:04 +08:00
parent 3da62fd254
commit 553e4d62f0
16 changed files with 1265 additions and 60 deletions

11
src/utils/extra.ts Normal file
View File

@@ -0,0 +1,11 @@
export function extractKeysFromBraces(text: string) {
const regex = /\{\{\s*(.*?)\s*\}\}/g;
const keys: string[] = [];
let matches: RegExpExecArray | null;
while ((matches = regex.exec(text)) !== null) {
keys.push(matches[1]); // 获取{{}}中间的key
}
return keys;
}