@akala/core
Version:
18 lines • 557 B
JavaScript
/**
* A formatter that negates boolean values.
* Converts any input to a boolean and returns its inverse.
*/
export default class Negate {
static instance = new Negate();
/**
* Converts the input to a boolean and returns its negation.
* @template T - The type of the input value.
* @param {T} value - The value to invert (non-booleans are coerced to boolean).
* @returns {boolean} The logical inverse of the input's boolean value.
*/
format(value) {
return !value;
}
}
;
//# sourceMappingURL=negate.js.map