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,16 +917,20 @@ 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){
return '' case 'ignore':{
return ''
}
case 'parse':{
return p1.trim()
}
case 'parse-pure':{
return p1
}
default:{
return ''
}
} }
if(type === 'parse'){
return p1.trim()
}
if(type === 'parse-pure'){
return p1
}
return ''
} }
export function risuChatParser(da:string, arg:{ export function risuChatParser(da:string, arg:{