-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Re-export ObjectOf, TupleOf and UniformTupleOf types #58
Conversation
WalkthroughThis update enhances the TypeScript codebase by refining and documenting key utility types: Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- is/factory.ts (3 hunks)
Additional comments: 9
is/factory.ts (9)
- 182-192: The documentation comment for
TupleOf
is clear and provides a good example of its usage. However, ensure that the example code is tested to verify its correctness.- 328-338: The documentation comment for
UniformTupleOf
is well-written, providing a clear explanation and example. This should help users understand how to use this type effectively.- 561-571: The documentation comment for
ObjectOf
is clear and informative, offering a straightforward example of its application. This enhances the usability of the type for developers.- 193-193: The export statement for
TupleOf
correctly reinstates its availability for external use, aligning with the PR objectives.- 340-340: The export statement for
UniformTupleOf
is correctly implemented, ensuring the type is accessible for external modules as intended.- 572-572: The export statement for
ObjectOf
is properly placed, making the type available for external use and addressing the compatibility issue.- 182-193: The logic within
isTupleOf
function appears to be correctly updated to handle both single and extended tuple types, enhancing its flexibility and utility.- 328-340: The logic in
isUniformTupleOf
function is correctly implemented to validate uniform tuples of a specified length and type, if provided. This ensures accurate type checking.- 561-584: The logic in
isObjectOf
function correctly handles the validation of object types based on provided predicates, including handling optional properties. This improves the robustness of type checking.
* // Above is equivalent to the following type | ||
* // type A = [string, number]; | ||
* ``` | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I read the previous is.ts in passing and then copied and pasted it, so my comments may not be in line with the new implementation. 🙇
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #58 +/- ##
=======================================
Coverage 97.79% 97.79%
=======================================
Files 8 8
Lines 635 635
Branches 68 68
=======================================
Hits 621 621
Misses 14 14 ☔ View full report in Codecov by Sentry. |
It was a deliberate change, but did it do any real harm? It is an incompatibility change, but I couldn't think of any actual use case for it, so I had to keep it minor as niche, but if there is a use case, I'll delete it via Deprecated. |
@lambdalisue thanks.I see. |
Some types are no longer exported in #57.
I don't know if this is what was intended, but I tried exporting them again because they were incompatible with earlier ones.
Summary by CodeRabbit