refactor: Convert case-insensitive matching to use toLocaleLowerCase()

This commit is contained in:
kwaroran
2024-05-28 19:37:02 +09:00
parent f847f47ac4
commit 48afa966b6

View File

@@ -253,12 +253,12 @@ export async function loadLoreBookV3Prompt(){
return false return false
} }
mText = mText.toLowerCase() mText = mText.toLocaleLowerCase()
if(arg.fullWordMatching){ if(arg.fullWordMatching){
const splited = mText.split(' ') const splited = mText.split(' ')
for(const key of arg.keys){ for(const key of arg.keys){
if(splited.includes(key)){ if(splited.includes(key.toLocaleLowerCase())){
return true return true
} }
} }
@@ -266,7 +266,7 @@ export async function loadLoreBookV3Prompt(){
else{ else{
mText = mText.replace(/ /g,'') mText = mText.replace(/ /g,'')
for(const key of arg.keys){ for(const key of arg.keys){
if(mText.includes(key)){ if(mText.includes(key.toLocaleLowerCase())){
return true return true
} }
} }