Refactor blockEndMatcher function to use switch statement

This commit is contained in:
kwaroran
2024-04-03 19:18:28 +09:00
parent 9d90901223
commit 28d4ee93cf

View File

@@ -917,17 +917,21 @@ function blockStartMatcher(p1:string,matcherArg:matcherArg):blockMatch{
} }
function blockEndMatcher(p1:string,type:blockMatch,matcherArg:matcherArg):string{ function blockEndMatcher(p1:string,type:blockMatch,matcherArg:matcherArg):string{
if(type === 'ignore'){ switch(type){
case 'ignore':{
return '' return ''
} }
if(type === 'parse'){ case 'parse':{
return p1.trim() return p1.trim()
} }
if(type === 'parse-pure'){ case 'parse-pure':{
return p1 return p1
} }
default:{
return '' return ''
} }
}
}
export function risuChatParser(da:string, arg:{ export function risuChatParser(da:string, arg:{
chatID?:number chatID?:number