refactor: Convert case-insensitive matching to use toLocaleLowerCase()
This commit is contained in:
@@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user