Refactor logical operators in parser.ts for better readability and consistency
This commit is contained in:
@@ -759,13 +759,13 @@ const matcher = (p1:string,matcherArg:matcherArg) => {
|
|||||||
return (Number(arra[1]) <= Number(arra[2])) ? '1' : '0'
|
return (Number(arra[1]) <= Number(arra[2])) ? '1' : '0'
|
||||||
}
|
}
|
||||||
case 'and':{
|
case 'and':{
|
||||||
return (Number(arra[1]) && Number(arra[2])) ? '1' : '0'
|
return arra[1] === '1' && arra[2] === '1' ? '1' : '0'
|
||||||
}
|
}
|
||||||
case 'or':{
|
case 'or':{
|
||||||
return (Number(arra[1]) || Number(arra[2])) ? '1' : '0'
|
return arra[1] === '1' || arra[2] === '1' ? '1' : '0'
|
||||||
}
|
}
|
||||||
case 'not':{
|
case 'not':{
|
||||||
return (Number(arra[1]) === 0) ? '1' : '0'
|
return arra[1] === '1' ? '0' : '1'
|
||||||
}
|
}
|
||||||
case 'file':{
|
case 'file':{
|
||||||
if(matcherArg.displaying){
|
if(matcherArg.displaying){
|
||||||
|
|||||||
Reference in New Issue
Block a user