1
0

Minor improvements

This commit is contained in:
2024-01-07 08:16:23 +01:00
parent 0af0bb0a56
commit aec90ead0c
2 changed files with 15 additions and 9 deletions

View File

@@ -1,12 +1,13 @@
const log = Java.type('org.slf4j.LoggerFactory').getLogger('js.lib');
log.info('Load lib module');
const log = Java.type('org.slf4j.LoggerFactory').getLogger('js.utils.lib');
log.info('Load utils.lib module');
function compare(a, b, operator) {
// Hint: a = currentState, b = targetState
let logMsg = '';
let returnValue = undefined;
try {
logMsg = `Quantity comparison of ${a}, ${b} with operator ${operator}`;
logMsg = `Quantity comparison of ${a} and ${b} with operator ${operator}`;
switch (operator) {
case '==':
returnValue = a.equal(b);
@@ -31,7 +32,7 @@ function compare(a, b, operator) {
return;
}
} catch(e) {
logMsg = `Standard comparison of ${a}, ${b} with operator ${operator}`;
logMsg = `Standard comparison of ${a} and ${b} with operator ${operator}`;
switch (operator) {
case '==':
returnValue = (a == b);