UNPKG

moy-fp

Version:
24 lines (20 loc) 615 B
import __ from '../../src/Function/__' /** * ((a, b, ..., m) -> Boolean) -> ((a, b, ..., m) -> Boolean) -> ((a, b, ..., m) -> Boolean) */ import either from '../../src/Logic/either' test('eithor(not using __), return true', () => { expect( either((a, b) => a + b > 10)((a, b) => a - b < -10)(5)(16) ).toBeTruthy() }) test('eithor(not using __), return false', () => { expect( either((a, b) => a + b > 10)((a, b) => a - b < -10)(5)(5) ).toBeFalsy() }) test('eithor(using __), return true', () => { expect( either(__, (a, b) => a - b < -10)((a, b) => a + b > 10)(5)(16) ).toBeTruthy() })