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

splitEvery typings are wrong #133

Open
codan84 opened this issue Dec 3, 2024 · 0 comments
Open

splitEvery typings are wrong #133

codan84 opened this issue Dec 3, 2024 · 0 comments

Comments

@codan84
Copy link

codan84 commented Dec 3, 2024

splitEvery takes 2 arguments and is curried so the following is possible:

splitEvery(2, [1,2,3,4,5,6])

splitEvery(2)([1,2,3,4,5,6])

However, your types are messed up making it hard to work with in TS:

export function splitEvery(a: number): {
  (list: string): string[];
  <T>(list: readonly T[]): T[][];
};
export function splitEvery(a: number, list: string): string[];
export function splitEvery<T>(a: number, list: readonly T[]): T[][];

Should be corrected to:

export function splitEvery(a: number, list: string): string[];
export function splitEvery(a: number): (list: string) => string[]

export function splitEvery<T>(a: number, list: readonly T[]): T[][];
export function splitEvery<T>(a: number): (list: readonly T[]) => T[][];
@kedashoe kedashoe transferred this issue from ramda/ramda Dec 4, 2024
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

1 participant