MCPcopy Create free account
hub / github.com/JsAaron/jQuery / winnow

Function winnow

2.1.1/test/jquery-2.1.1.js:2606–2633  ·  view source on GitHub ↗
( elements, qualifier, not )

Source from the content-addressed store, hash-verified

2604
2605// Implement the identical functionality for filter and not
2606function winnow( elements, qualifier, not ) {
2607 if ( jQuery.isFunction( qualifier ) ) {
2608 return jQuery.grep( elements, function( elem, i ) {
2609 /* jshint -W018 */
2610 return !!qualifier.call( elem, i, elem ) !== not;
2611 });
2612
2613 }
2614
2615 if ( qualifier.nodeType ) {
2616 return jQuery.grep( elements, function( elem ) {
2617 return ( elem === qualifier ) !== not;
2618 });
2619
2620 }
2621
2622 if ( typeof qualifier === "string" ) {
2623 if ( risSimple.test( qualifier ) ) {
2624 return jQuery.filter( qualifier, elements, not );
2625 }
2626
2627 qualifier = jQuery.filter( qualifier, elements );
2628 }
2629
2630 return jQuery.grep( elements, function( elem ) {
2631 return ( indexOf.call( qualifier, elem ) >= 0 ) !== not;
2632 });
2633}
2634
2635jQuery.filter = function( expr, elems, not ) {
2636 var elem = elems[ 0 ];

Callers 1

jquery-2.1.1.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected