Skip to content

Commit

Permalink
added function comment
Browse files Browse the repository at this point in the history
  • Loading branch information
5saviahv committed Jan 27, 2021
1 parent 2f065a9 commit 12f9177
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions lib/api/traversing.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ var uniqueSort = require('htmlparser2').DomUtils.uniqueSort;
var isTag = utils.isTag;
var reSiblingSelector = /^\s*[~+]/;

/**
* Matcher provides function, what finds elements based on function provided. It
* also houses filtering. What may provided later when function is called.
*
* @private
* @param {Function} fn - Function for collecting elements.
* @param {boolean} reverse - Is output in reverse order.
* @returns {Function} - Wrapped function.
*/
function _matcher(fn, reverse) {
// customized Map, discards null elements
function matchMap(elems, cb, arg) {
Expand Down
2 changes: 1 addition & 1 deletion test/api/traversing.js
Original file line number Diff line number Diff line change
Expand Up @@ -556,10 +556,10 @@ describe('$(...)', function () {

expect($parents).toHaveLength(5);
expect($parents[0]).toBe($('#vegetables')[0]);
expect($parents[1]).toBe($('#fruits')[0]);
expect($parents[2]).toBe($('#food')[0]);
expect($parents[3]).toBe($('body')[0]);
expect($parents[4]).toBe($('html')[0]);
expect($parents[1]).toBe($('#fruits')[0]);
});
});

Expand Down

0 comments on commit 12f9177

Please sign in to comment.