* Returns a function to use in pseudos for positionals * @param {Function} fn
(fn)
| 464 | */ |
| 465 | |
| 466 | function createPositionalPseudo(fn) { |
| 467 | return markFunction(function(argument) { |
| 468 | argument = +argument; |
| 469 | return markFunction(function(seed, matches) { |
| 470 | var j, |
| 471 | matchIndexes = fn([], seed.length, argument), |
| 472 | i = matchIndexes.length; |
| 473 | |
| 474 | // Match elements found at the specified indexes |
| 475 | while (i--) { |
| 476 | if (seed[(j = matchIndexes[i])]) { |
| 477 | seed[j] = !(matches[j] = seed[j]); |
| 478 | } |
| 479 | } |
| 480 | }); |
| 481 | }); |
| 482 | } |
| 483 | |
| 484 | /** |
| 485 | * Detect xml |
no test coverage detected