-
Notifications
You must be signed in to change notification settings - Fork 147
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
takeWhile(f) added, issues #378, #675 #677
Conversation
lib/index.js
Outdated
catch (e) { | ||
fnErr = e; | ||
} | ||
if (fnVal) { |
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.
Reverse this.
if (fnErr) {
...
next();
} else if (fnVal) {
...
next();
} else {
push(null, nil);
}
You want to check for fnErr
first, since you need to push nil
if fnVal
is false
.
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.
done!
lib/index.js
Outdated
* @throws {TypeError} if `f` is not a function. | ||
* @api public | ||
* | ||
* _([1, 2, 3, 4]).takeWhile(x => x<3) // => 1, 2 |
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.
* _([1, 2, 3, 4]).takeWhile(x => x<3) // => 1, 2 | |
* _([1, 2, 3, 4]).takeWhile(x => x < 3) // => 1, 2 |
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.
done!
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 also add an entry to the CHANGELOG.md for 3.0.0-beta.10
. Use the format of the previous entries.
Co-Authored-By: mauriciocap <mauriciocap@gmail.com>
…hland into takeWhile_from_issue_378
As suggested in #675 and #378