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

Update: Map #26

Merged
merged 12 commits into from
May 26, 2023
Merged

Update: Map #26

merged 12 commits into from
May 26, 2023

Conversation

Harris-Miller
Copy link
Collaborator

@Harris-Miller Harris-Miller commented Apr 28, 2023

This MR updates map to support mapping over an array, an object, or a Functor.

Caveat: due to typescript limitations, when passing map(a) into another function as a variable, typescript defaults to the last overload, this means that while the following works:

map(toString)([1, 2, 3]); // ok
map(toString)({ a: 1, b: 2, c: 3 }); // ok

Passing to pipe only supports arrays

pipe(map(toString))([1, 2, 3]); // ok
pipe(map(toString))({ a: 1, b: 2, c: 3 }); // error

I have a few ideas for how to fix the above caveat, and I will address it in a new issue

@Harris-Miller Harris-Miller changed the title New: Map Update: Map Apr 28, 2023
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

Successfully merging this pull request may close these issues.

1 participant