Skip to content
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

Closed
wants to merge 8 commits into from

Conversation

mapogolions
Copy link

No description provided.

@mapogolions mapogolions changed the title Express some high order functions in terms of other Express some higher order functions in terms of other Jul 30, 2019
lib/array.js Outdated Show resolved Hide resolved
mapogolions and others added 2 commits January 17, 2020 20:24
Co-Authored-By: Vitaliy Semenchenko <semenchenkovitaliy@gmail.com>
const metasync = require('..');
const metatests = require('metatests');

metatests.test('findIndex with error', test => {
Copy link
Member

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 ;-)

Suggested change
metatests.test('findIndex with error', test => {
metatests.test('findIndex with an error', test => {

});
});

metatests.test('with empty array', test => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
metatests.test('with empty array', test => {
metatests.test('with an empty array', test => {

);
});

metatests.test('with array without element which is searching', test => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@mapogolions
Copy link
Author

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

@mapogolions mapogolions closed this Feb 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants