( elements, qualifier, not )
| 3037 | |
| 3038 | // Implement the identical functionality for filter and not |
| 3039 | function winnow( elements, qualifier, not ) { |
| 3040 | if ( isFunction( qualifier ) ) { |
| 3041 | return jQuery.grep( elements, function( elem, i ) { |
| 3042 | return !!qualifier.call( elem, i, elem ) !== not; |
| 3043 | } ); |
| 3044 | } |
| 3045 | |
| 3046 | // Single element |
| 3047 | if ( qualifier.nodeType ) { |
| 3048 | return jQuery.grep( elements, function( elem ) { |
| 3049 | return ( elem === qualifier ) !== not; |
| 3050 | } ); |
| 3051 | } |
| 3052 | |
| 3053 | // Arraylike of elements (jQuery, arguments, Array) |
| 3054 | if ( typeof qualifier !== "string" ) { |
| 3055 | return jQuery.grep( elements, function( elem ) { |
| 3056 | return ( indexOf.call( qualifier, elem ) > -1 ) !== not; |
| 3057 | } ); |
| 3058 | } |
| 3059 | |
| 3060 | // Filtered directly for both simple and complex selectors |
| 3061 | return jQuery.filter( qualifier, elements, not ); |
| 3062 | } |
| 3063 | |
| 3064 | jQuery.filter = function( expr, elems, not ) { |
| 3065 | var elem = elems[ 0 ]; |
no test coverage detected