-
-
Notifications
You must be signed in to change notification settings - Fork 512
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
feat: add iter/cunone
#2616
feat: add iter/cunone
#2616
Conversation
@kgryte now can you review this !!! |
@kgryte review this ? |
limitations under the License. | ||
|
||
--> | ||
|
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 file needs updating. It does not match project conventions.
@@ -0,0 +1,96 @@ | |||
/** * @license Apache-2.0 |
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 how we do license headers.
@@ -0,0 +1,53 @@ | |||
{{alias}}( iterator ) |
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 how we format REPL text files.
* var bool = it.next().done; | ||
* // returns true | ||
*/ | ||
declare function iterCuNone( iterator: Iterator ): Iterator; |
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 return type can be improved. Use TypedIterator
from types/iter
.
* @returns iterator protocol-compliant object | ||
*/ | ||
function iterator() { | ||
return { |
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.
Incorrect indentation.
// The compiler throws an error if the function is provided insufficient arguments... | ||
{ | ||
iterCuNone(); // $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.
It is clear that you did not follow the contributing guidelines and setup EditorConfig.
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 file should not have been changed. Revert the changes.
@@ -0,0 +1,85 @@ | |||
{ | |||
"name": "@stdlib/iter/cunone", |
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.
Indentation is off.
"scripts": { | ||
"test": "make test", | ||
"test-cov": "make test-cov", | ||
"examples": "make examples", | ||
"benchmark": "make benchmark" | ||
}, |
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 should be empty.
"@stdlib/assert-is-iterator-like": "^0.0.x", | ||
"@stdlib/symbol-iterator": "^0.0.x", | ||
"@stdlib/types": "^0.0.x", | ||
"@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x", | ||
"@stdlib/error-tools-fmtprodmsg": "^0.0.x" | ||
}, | ||
"devDependencies": { | ||
"@stdlib/array-to-iterator": "^0.0.x", | ||
"@stdlib/assert-is-boolean": "^0.0.x", | ||
"@stdlib/random-iter-randu": "^0.0.x", | ||
"tape": "git+https://github.com/kgryte/tape.git#fix/globby", | ||
"istanbul": "^0.4.1", | ||
"tap-min": "git+https://github.com/Planeshifter/tap-min.git" |
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 incorrect.
}); | ||
|
||
tape( 'if an environment does not support `Symbol.iterator`, the returned iterator is not "iterable"', function test( t ) { | ||
var iterCuNone; |
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.
Indentation.
// Perform manual iteration... | ||
var v; | ||
while ( true ) { | ||
v = result.next(); |
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.
Indentation.
* @module @stdlib/iter-cunone | ||
* | ||
* @example | ||
* var array2iterator = require( '@stdlib/array-to-iterator' ); | ||
* var iterCuNone = require( '@stdlib/iter-cunone' ); |
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.
Incorrect package names.
if (v.done) { | ||
return v; | ||
} | ||
if (FLG === false && v.value) { |
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.
Inconsistent spacing.
var v; | ||
var result; |
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.
Incorrect order.
if (v.done) { | ||
return v; | ||
} | ||
if (FLG === false && v.value) { |
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.
FLG
is undefined. This implementation won't work.
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 PR needs significant changes in order to be further reviewed and considered for inclusion. Please read the project contributing guidelines. Based on the number of lint errors, it is clear that you did not setup your local dev environment for contributing to stdlib. Please ensure that you have rectified this before contributing further.
This pull request has been automatically closed because it has been inactive for an extended period after changes were requested. If you still wish to pursue this contribution, feel free to reopen the pull request or submit a new one. We appreciate your interest in contributing to stdlib! |
Resolves #2333.
Description
This pull request:
itercunone
Related Issues
This pull request:
@stdlib/iter/cunone
#2333Questions
No.
Other
This implementation:
true
while all values are falsyfalse
once a truthy value is encountered and for all subsequent iterationsChecklist
@stdlib-js/reviewers