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

Function createPositionalPseudo

dist-module/jquery.factory.slim.module.js:1381–1397  ·  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

1379 * @param {Function} fn
1380 */
1381function createPositionalPseudo( fn ) {
1382 return markFunction( function( argument ) {
1383 argument = +argument;
1384 return markFunction( function( seed, matches ) {
1385 var j,
1386 matchIndexes = fn( [], seed.length, argument ),
1387 i = matchIndexes.length;
1388
1389 // Match elements found at the specified indexes
1390 while ( i-- ) {
1391 if ( seed[ ( j = matchIndexes[ i ] ) ] ) {
1392 seed[ j ] = !( matches[ j ] = seed[ j ] );
1393 }
1394 }
1395 } );
1396 } );
1397}
1398
1399/**
1400 * Sets document-related variables once based on the current document

Callers 1

jQueryFactoryWrapperFunction · 0.70

Calls 2

markFunctionFunction · 0.70
fnFunction · 0.50

Tested by

no test coverage detected