Skip to content

feat(pipe): implement pipe#1521

Open
deivshon wants to merge 3 commits intotoss:mainfrom
deivshon:feat/pipe
Open

feat(pipe): implement pipe#1521
deivshon wants to merge 3 commits intotoss:mainfrom
deivshon:feat/pipe

Conversation

@deivshon
Copy link

This PR implements the pipe function, as requested in the current second most upvoted issue (#1187).

Added:

  • pipe function implementation
  • pipe tests (including type-level)
  • pipe docs (note: I do not know Korean, Japanese or Chinese and used an LLM to translate the English ones, which I wrote myself)
  • pipe performance benchmark (I did not add the bundle size one as I reckoned only the utilities that have a Lodash equivalent needed it)

Here is the screenshot of the performance benchmark results:
benchmark-results

@vercel
Copy link

vercel bot commented Nov 16, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
es-toolkit Ready Ready Preview Comment Nov 16, 2025 7:20pm

@jindong-zhannng
Copy link

Any plan of reviewing and merging this PR?

@T3sT3ro
Copy link
Contributor

T3sT3ro commented Dec 22, 2025

Would taking inspiration from this repo to type the pipe using some type magic be too much?

https://github.com/MathisBullinger/froebel/blob/main/pipe.ts

@deivshon
Copy link
Author

deivshon commented Jan 1, 2026

Would taking inspiration from this repo to type the pipe using some type magic be too much?

https://github.com/MathisBullinger/froebel/blob/main/pipe.ts

Given how flow has been implemented and that design principles outlined in the CONTRIBUTING.md file highlight simplicity as one of the core values of the project, I'd say such type magic might be too much.

The way it's set up in this PR now makes pipe support strict typing for up to 8 functions passed to it and falls back to being any-typed after, which I would argue is a decent deal, as I think it would fit the vast majority of use cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants