ws-rmi
Version:
A Remote Method Invocation implementation written in JavaScript utilising the WebSocket protocol
20 lines (19 loc) • 730 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.isEqualToAny = exports.xor = void 0;
/**
* Returns the XOR of two boolean conditions; that is, if either condition1 OR condition2 is true, but not both.
*
* @param condition1 The first condition.
* @param condition2 The second condition.
*/
const xor = (condition1, condition2) => !condition1 !== !condition2;
exports.xor = xor;
/**
* Returns whether the given value is equal to any of the items in compareTo.
*
* @param value The value to compare.
* @param compareTo The values to be compared against value.
*/
const isEqualToAny = (value, ...compareTo) => compareTo.some(item => value === item);
exports.isEqualToAny = isEqualToAny;