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

fix(traversing): Fix filter for {prev,next}Until #1728

Merged
merged 1 commit into from
Feb 11, 2021
Merged

fix(traversing): Fix filter for {prev,next}Until #1728

merged 1 commit into from
Feb 11, 2021

Conversation

fb55
Copy link
Member

@fb55 fb55 commented Feb 11, 2021

Continuation of #1708, fixing up untilNodes for {prev,next}Until.

Continuation of #1708, fixing up `untilNodes` for `{prev,next}Until`.
@fb55 fb55 requested a review from 5saviahv February 11, 2021 02:47
@@ -181,9 +181,9 @@ exports.parentsUntil = function (selector, filter) {
}
}, this);

return this._make(
Copy link
Member Author

Choose a reason for hiding this comment

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

Updated this to match the pattern of most other functions.

Copy link
Contributor

Choose a reason for hiding this comment

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

hmm, yes you are correct other traversing functions use filter function like that.

@fb55
Copy link
Member Author

fb55 commented Feb 11, 2021

@5saviahv I know that #1662 is still open (which would fix all similar issues), but this seems worth its own fix.

Copy link
Contributor

@5saviahv 5saviahv left a comment

Choose a reason for hiding this comment

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

Nice, I thought those functions should also be updated.

@@ -181,9 +181,9 @@ exports.parentsUntil = function (selector, filter) {
}
}, this);

return this._make(
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm, yes you are correct other traversing functions use filter function like that.

@@ -314,7 +314,7 @@ exports.nextUntil = function (selector, filterSelector) {
var untilNodes;

if (typeof selector === 'string') {
untilNode = select.select(selector, this.nextAll().get(), this.options)[0];
untilNodes = this.nextAll(selector).toArray();
Copy link
Contributor

Choose a reason for hiding this comment

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

nice

@@ -432,7 +432,7 @@ exports.prevUntil = function (selector, filterSelector) {
var untilNodes;

if (typeof selector === 'string') {
untilNode = select.select(selector, this.prevAll().get(), this.options)[0];
untilNodes = this.prevAll(selector).toArray();
Copy link
Contributor

Choose a reason for hiding this comment

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

nice

@fb55 fb55 merged commit f2615d2 into main Feb 11, 2021
@fb55 fb55 deleted the fix/filters branch February 11, 2021 16:49
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.

None yet

2 participants