UNPKG

@prelude/cmp

Version:

Cmp module.

14 lines 411 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Number comparision function. * @throws {@link TypeError} if `a` or `b` are {@link NaN}. */ const number = (a, b) => { if (isNaN(a) || isNaN(b)) { throw new TypeError('Expected number, got NaN.'); } return ((a > b ? 1 : 0) - (b > a ? 1 : 0)); }; exports.default = number; //# sourceMappingURL=number.js.map