deno.land / x / rambda@v9.1.1 / source / both-spec.ts
123456789101112131415161718192021222324252627282930313233343536373839404142434445import {both} from 'rambda'
describe('R.both', () => { it('with passed type', () => { const fn = both<number>( x => x > 1, x => x % 2 === 0 ) fn // $ExpectType Predicate<number> const result = fn(2) // $ExpectType boolean result // $ExpectType boolean }) it('with passed type - curried', () => { const fn = both<number>(x => x > 1)(x => x % 2 === 0) fn // $ExpectType Predicate<number> const result = fn(2) result // $ExpectType boolean }) it('no type passed', () => { const fn = both( x => { x // $ExpectType any return x > 1 }, x => { x // $ExpectType any return x % 2 === 0 } ) const result = fn(2) result // $ExpectType boolean }) it('no type passed - curried', () => { const fn = both((x: number) => { x // $ExpectType number return x > 1 })((x: number) => { x // $ExpectType number return x % 2 === 0 }) const result = fn(2) result // $ExpectType boolean })})
Version Info