typed-typings / npm-ramda

TypeScript's type definitions for Ramda
MIT License
384 stars 64 forks source link

pipe combined with head produces typescript error #415

Closed redmundas closed 5 years ago

redmundas commented 5 years ago

So I have a similar code to this:

const list = [{id: 100}];
const test = pipe(head)(list);

and it produces this error:

error TS2554: Expected 0 arguments, but got 1.

25 const test = pipe(head)(list);
ikatyang commented 5 years ago

Hi, you need to hint TS to get proper type, for example:

const test = pipe(head<"1", "general">())(list);
//                    ^^^^^^^^^^^^^^^^^^

or its shortcut:

const test = pipe(head())(list);
//                    ^^