DefinitelyTyped/types/ramda
Miika Hänninen b8b95c0cf8 ramda: Workaround for type inference problem in Filter (#28592)
* ramda: add return type assertions for filter/reject test

* ramda: Add failing test for filter-in-pipe scenario

* ramda: Workaround for type inference problem in Filter

In the `Filter` type, when used inside a pipe, the second format always took
precedence in type inference, causing problems when a list was filtered.

With this change, you can manually specify whether you are using filter
for an array or an object, so usage in a pipe will work. You can also
leave out the second type parameter, in which case filter works as
previously.

```ts
import { pipe, filter } from 'ramda';

pipe(
    filter<string, 'array'>((val: string) => val.length > 2),
)(['list', 'or', 'object']);

pipe(
    filter<string, 'object'>((val) => val.length > 2),
)({ a: 'list', b: 'or', c: 'object' });
```
2018-10-02 11:34:46 -07:00
..
index.d.ts ramda: Workaround for type inference problem in Filter (#28592) 2018-10-02 11:34:46 -07:00
ramda-tests.ts ramda: Workaround for type inference problem in Filter (#28592) 2018-10-02 11:34:46 -07:00
tsconfig.json
tslint.json