Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lodash fp pipe with compact #31044

Closed
4 tasks done
lfender6445 opened this issue Dec 4, 2018 · 2 comments
Closed
4 tasks done

lodash fp pipe with compact #31044

lfender6445 opened this issue Dec 4, 2018 · 2 comments

Comments

@lfender6445
Copy link

lfender6445 commented Dec 4, 2018


I am getting an error from TSC when compiling the following code

import * as pipe from  'lodash/fp/pipe'
import * as compact from 'lodash/fp/compact'

const foo = [1,'',2,'',3]

pipe(compact)(foo)

Argument of type 'LodashCompact' is not assignable to parameter of type 'Many<(...args: any[]) => any>[]'.
Property 'push' is missing in type 'LodashCompact'.

6 pipe(compact)(foo)

@lfender6445
Copy link
Author

ignore this, i realized the arity here was wrong

@RobinBuschmann
Copy link

@lfender6445 Did you get it working with strictNullChecks? With strictNullChecks enabled I'm getting a similar error compiling the following:

import {pipe, compact, flatten} from 'lodash/fp';

const arr = [[['a']], [['c']], [['b']]];

pipe(compact, flatten)(arr);

Error:(5, 6) TS2345: Argument of type 'LodashCompact' is not assignable to parameter of type '(a1: {}, a2: {}, a3: {}, a4: {}, ...args: any[]) => {}[]'.
Types of parameters 'array' and 'a1' are incompatible.
Property 'length' is missing in type '{}' but required in type 'ArrayLike<false | {} | "" | 0 | null | undefined>'.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants