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

Internal / Functions: add flow function #5

Merged
merged 8 commits into from
Jun 2, 2024

Conversation

suddenlyGiovanni
Copy link
Owner

@suddenlyGiovanni suddenlyGiovanni commented Jun 2, 2024

The flow function, which performs left-to-right function composition, was added to src/internal/function.ts file. The functionality of flow was subsequently validated through newly introduced tests. Additionally, detailed comments were added for each overload of flow to enhance readability.

The import statement for assertStrictEquals in function.ts has been
updated to not include a specific version. This minor change is made
to ensure that the latest version of 'assert' package is always used.
The pipe function was refactored to use rest parameters for increased
 readability and ease of use. This modification makes the function
 more flexible and shortens the code by eliminating redundant lines.
A new function named 'flow' was added to the 'function.ts' file. This
 function performs left-to-right function composition. Changes have
 also been made in the 'function.test.ts' to include tests for the
 newly added 'flow' function.
The import path in the predicate.test.ts and predicate.ts files has
been changed to the correct ones. Also, a new 'type' test has been
added in predicate.test.ts to check the type.
The flow function inside the src/internal/function.ts file has been
enhanced with additional overloads to handle varying function arities
. This provides more flexibility when creating function pipelines
with multiple steps, supporting more complex data transformations.
Expanded the comments for the pipe function overloads to clearly list
 their arity. This improves readability of the code and provides
 immediate information about the function overloads without the need
 for additional documentation look-up.
Copy link

codecov bot commented Jun 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (174f703) to head (1259f0e).

Additional details and impacted files
@@            Coverage Diff            @@
##              main        #5   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         3           
  Lines          182       226   +44     
  Branches        21        32   +11     
=========================================
+ Hits           182       226   +44     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

This commit includes the added directive to ignore linting for the
'no-explicit-any' rule. This is necessary for the predicate.test.ts
file to ensure efficient testing without any linting interference.
@suddenlyGiovanni suddenlyGiovanni marked this pull request as ready for review June 2, 2024 20:37
@suddenlyGiovanni suddenlyGiovanni merged commit 0d795a0 into main Jun 2, 2024
4 of 5 checks passed
@suddenlyGiovanni suddenlyGiovanni deleted the internal/functions branch June 2, 2024 20:37
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