Minor improvements
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user