MCPcopy Index your code
hub / github.com/jquery/jquery / createPositionalPseudo

Function createPositionalPseudo

src/selector.js:298–314  ·  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

296 * @param {Function} fn
297 */
298function createPositionalPseudo( fn ) {
299 return markFunction( function( argument ) {
300 argument = +argument;
301 return markFunction( function( seed, matches ) {
302 var j,
303 matchIndexes = fn( [], seed.length, argument ),
304 i = matchIndexes.length;
305
306 // Match elements found at the specified indexes
307 while ( i-- ) {
308 if ( seed[ ( j = matchIndexes[ i ] ) ] ) {
309 seed[ j ] = !( matches[ j ] = seed[ j ] );
310 }
311 }
312 } );
313 } );
314}
315
316/**
317 * Sets document-related variables once based on the current document

Callers 1

selector.jsFile · 0.70

Calls 2

markFunctionFunction · 0.70
fnFunction · 0.50

Tested by

no test coverage detected