aboutsummaryrefslogtreecommitdiffstats
path: root/src/traversing/findFilter.js
diff options
context:
space:
mode:
authorOleg Gaidarenko <markelog@gmail.com>2016-07-15 21:42:25 +0400
committerGitHub <noreply@github.com>2016-07-15 21:42:25 +0400
commite4fd41f8fa4190fbbb6cb98cf7ace64f6e00685d (patch)
treec9957f8e6da0b814dfd11a5d1d61d969f7be4efd /src/traversing/findFilter.js
parent96966c022079e3956018717136367fbf4ed548a2 (diff)
downloadjquery-e4fd41f8fa4190fbbb6cb98cf7ace64f6e00685d.tar.gz
jquery-e4fd41f8fa4190fbbb6cb98cf7ace64f6e00685d.zip
Build: Update eslint config and fix associated errors
Diffstat (limited to 'src/traversing/findFilter.js')
-rw-r--r--src/traversing/findFilter.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/traversing/findFilter.js b/src/traversing/findFilter.js
index c742fb5c3..92d6753b4 100644
--- a/src/traversing/findFilter.js
+++ b/src/traversing/findFilter.js
@@ -45,11 +45,13 @@ jQuery.filter = function( expr, elems, not ) {
expr = ":not(" + expr + ")";
}
- return elems.length === 1 && elem.nodeType === 1 ?
- jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
- jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
- return elem.nodeType === 1;
- } ) );
+ if ( elems.length === 1 && elem.nodeType === 1 ) {
+ return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];
+ }
+
+ return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
+ return elem.nodeType === 1;
+ } ) );
};
jQuery.fn.extend( {