Special keywords are not excluded as duplicates

Special keywords like AND and BREAK might be written multiple times
within the prompt, so I've made changes to ensure they are not excluded
even if they appear duplicated.
pull/4/head
S-Del 2023-08-22 15:54:29 +09:00
parent 57a7d7e74f
commit fdac8b4e76
1 changed files with 7 additions and 2 deletions

View File

@ -53,10 +53,15 @@
if (!cleanArray.includes(cleanedTag)) { if (!cleanArray.includes(cleanedTag)) {
cleanArray.push(cleanedTag) cleanArray.push(cleanedTag)
finalArray.push(tag) finalArray.push(tag)
} else { return
finalArray.push(tag.replace(cleanedTag, ''))
} }
if (/^(AND|BREAK)$/.test(cleanedTag)) {
finalArray.push(tag)
return
}
finalArray.push(tag.replace(cleanedTag, ''))
}) })
input = finalArray.join(', ') input = finalArray.join(', ')