Skip to main content
Module

x/rambda/source/filterObject-spec.ts

Faster and smaller alternative to Ramda
Go to Latest
File
import {filterObject} from 'rambda'
const obj = {a: 1, b: 2}
describe('R.filterObject', () => { it('happy', () => { const result = filterObject((val, prop, origin) => { val // $ExpectType number prop // $ExpectType string origin // $ExpectType Dictionary<number>
return val > 1 }, obj) result // $ExpectType Dictionary<number> }) it('curried version requires explicit type', () => { const result = filterObject<number>((val, prop, origin) => { val // $ExpectType number prop // $ExpectType string origin // $ExpectType Dictionary<number>
return val > 1 })(obj) result // $ExpectType Dictionary<number> })})