MCPcopy
hub / github.com/jquery/jquery / createPositionalPseudo

Function createPositionalPseudo

test/data/jquery-3.7.1.js:1077–1093  ·  view source on GitHub ↗

* Returns a function to use in pseudos for positionals * @param {Function} fn

( fn )

Source from the content-addressed store, hash-verified

1075 * @param {Function} fn
1076 */
1077function createPositionalPseudo( fn ) {
1078 return markFunction( function( argument ) {
1079 argument = +argument;
1080 return markFunction( function( seed, matches ) {
1081 var j,
1082 matchIndexes = fn( [], seed.length, argument ),
1083 i = matchIndexes.length;
1084
1085 // Match elements found at the specified indexes
1086 while ( i-- ) {
1087 if ( seed[ ( j = matchIndexes[ i ] ) ] ) {
1088 seed[ j ] = !( matches[ j ] = seed[ j ] );
1089 }
1090 }
1091 } );
1092 } );
1093}
1094
1095/**
1096 * Checks a node for validity as a jQuery selector context

Callers 1

jquery-3.7.1.jsFile · 0.70

Calls 2

markFunctionFunction · 0.70
fnFunction · 0.50

Tested by

no test coverage detected