refac: input prompt

This commit is contained in:
Timothy Jaeryang Baek
2025-04-04 09:11:54 -06:00
parent 77fa11098a
commit feaf434d4e
6 changed files with 35 additions and 41 deletions

View File

@@ -361,14 +361,14 @@ export const compareVersion = (latest, current) => {
}) < 0;
};
export const findWordIndices = (text) => {
const regex = /\[([^\]]+)\]/g;
export const extractCurlyBraceWords = (text) => {
const regex = /\{\{([^}]+)\}\}/g;
const matches = [];
let match;
while ((match = regex.exec(text)) !== null) {
matches.push({
word: match[1],
word: match[1].trim(),
startIndex: match.index,
endIndex: regex.lastIndex - 1
});