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

pathOr types don't match path types #90

Closed
chimon2000 opened this issue Jan 18, 2019 · 1 comment
Closed

pathOr types don't match path types #90

chimon2000 opened this issue Jan 18, 2019 · 1 comment

Comments

@chimon2000
Copy link

In the site documentation, there is an example of pathOr with a string for the path property:

R.pathOr(1, 'a.b', {a: {b: 2}}) // => 2

This causes an error when using TypeScript because the definitions do not allow a string like they do with the path function.

rambda/index.d.ts

Lines 391 to 396 in b27e21d

path<T>(path: Path | string, obj: any): T
path<T>(path: Path | string): (obj: any) => T
pathOr<T>(d: T, p: Path, obj: any): T | any
pathOr<T>(d: T, p: Path): (obj: any) => T | any
pathOr<T>(d: T): CurriedFunction2<Path, any, T | any>

@selfrefactor
Copy link
Owner

Duly noted, will fix it in two days as I cannot do so earlier than that.

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