-
-
Notifications
You must be signed in to change notification settings - Fork 836
feat: add iter/cartesian-product
#1399
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
Conversation
@shubhexists hey, I cannot seem to run benchmark.js on the feat I added (@stdlib/utils/parse-ndjson) #1394 . I'm getting this error. I have debug in node_modules as well as in package.json. Did you encounter it too? |
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.
Hi @shubhexists, thanks for opening this PR!
I left some comments in this PR to get this approved, please let me know if you have any further question about any of them :)
iterCartesianProduct( [ 1, 2, 3 ], [ 4, 5, 6 ] ); // $ExpectType Iterator | ||
} | ||
|
||
// The compiler throws an error if the function is provided a first argument which is not array-like... |
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.
Please add a case for string
, boolean
, null
and undefined
to both arguments.
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.
This is not resolved yet, I meant we need to add the case for these dtypes for the error cases rather than the correct case
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.
This is still not resolved
Hi @steff456 , my idea of using What are your opinions? |
@stdlib/iter/cartesian-product
iter/cartesian-product
@shubhexists you are right, let's leave the examples with |
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.
Thanks for the changes @shubhexists, there are still a couple of tiny fixes before this PR is ready!
iterCartesianProduct( [ 1, 2, 3 ], [ 4, 5, 6 ] ); // $ExpectType Iterator | ||
} | ||
|
||
// The compiler throws an error if the function is provided a first argument which is not array-like... |
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.
This is not resolved yet, I meant we need to add the case for these dtypes for the error cases rather than the correct case
Co-authored-by: Stephannie Jimenez Gacha <steff456@users.noreply.github.com> Signed-off-by: Shubham <shubh622005@gmail.com>
@steff456 Kindly have a look now |
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.
There's still a minor change for this PR to be ready.
iterCartesianProduct( [ 1, 2, 3 ], [ 4, 5, 6 ] ); // $ExpectType Iterator | ||
} | ||
|
||
// The compiler throws an error if the function is provided a first argument which is not array-like... |
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.
This is still not resolved
iterCartesianProduct( 2, [ 4, 5, 6 ] ); // $ExpectError | ||
iterCartesianProduct( false, [ 4, 5, 6 ] ); // $ExpectError | ||
iterCartesianProduct( true, [ 4, 5, 6 ] ); // $ExpectError | ||
iterCartesianProduct( {}, [ 4, 5, 6 ] ); // $ExpectError |
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.
The previous comment meant to add cases where the first argument is string
, boolean
, null
and undefined
iterCartesianProduct( {}, [ 4, 5, 6 ] ); // $ExpectError | |
iterCartesianProduct( {}, [ 4, 5, 6 ] ); // $ExpectError | |
iterCartesianProduct( 'a', [ 4, 5, 6 ] ); // $ExpectError | |
iterCartesianProduct( null, [ 4, 5, 6 ] ); // $ExpectError | |
iterCartesianProduct( undefined, [ 4, 5, 6 ] ); // $ExpectError |
Please do the same for the other test cases.
Resolves #1335
Description
This pull request:
Related Issues
#1335
Questions
No.
Other
TESTS
BENCHMARKS

EXAMPLES

Checklist
@stdlib-js/reviewers