Refactor logical operators in parser.ts for better readability and consistency

This commit is contained in:
kwaroran
2024-04-08 10:09:42 +09:00
parent c6fbe7f58b
commit e65785b225

View File

@@ -759,13 +759,13 @@ const matcher = (p1:string,matcherArg:matcherArg) => {
return (Number(arra[1]) <= Number(arra[2])) ? '1' : '0'
}
case 'and':{
return (Number(arra[1]) && Number(arra[2])) ? '1' : '0'
return arra[1] === '1' && arra[2] === '1' ? '1' : '0'
}
case 'or':{
return (Number(arra[1]) || Number(arra[2])) ? '1' : '0'
return arra[1] === '1' || arra[2] === '1' ? '1' : '0'
}
case 'not':{
return (Number(arra[1]) === 0) ? '1' : '0'
return arra[1] === '1' ? '0' : '1'
}
case 'file':{
if(matcherArg.displaying){