-
Notifications
You must be signed in to change notification settings - Fork 35
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
Express some higher order functions in terms of other #437
Conversation
Co-Authored-By: Vitaliy Semenchenko <semenchenkovitaliy@gmail.com>
const metasync = require('..'); | ||
const metatests = require('metatests'); | ||
|
||
metatests.test('findIndex with error', test => { |
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.
Tests are good 👍
Just nitpicking a grammar, not that important ;-)
metatests.test('findIndex with error', test => { | |
metatests.test('findIndex with an error', test => { |
}); | ||
}); | ||
|
||
metatests.test('with empty array', test => { |
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.
metatests.test('with empty array', test => { | |
metatests.test('with an empty array', test => { |
); | ||
}); | ||
|
||
metatests.test('with array without element which is searching', test => { |
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.
metatests.test('with array without element which is searching', test => { | |
metatests.test('with an array not containing the searched element', test => { |
done(err, err ? undefined : false); | ||
return; | ||
} | ||
done(null, true); |
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(null, true); | |
done(null, index !== -1); |
And then it's possible to simplify the check upper to
if (err) {
done(err);
return;
}
|
||
if (len > 0) next(); | ||
else done(null, false); | ||
done(null, true); |
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.
ditto
Thanks, I really appreciate it. I found a problem that could affect the future of this pull request (#442). I will resolve all conversions above as soon as this issue is resolved |
No description provided.