* Returns a function to use in pseudos for positionals * @param {Function} fn
(fn)
| 419 | */ |
| 420 | |
| 421 | function createPositionalPseudo(fn) { |
| 422 | return markFunction(function(argument) { |
| 423 | argument = +argument; |
| 424 | return markFunction(function(seed, matches) { |
| 425 | var j, |
| 426 | matchIndexes = fn([], seed.length, argument), |
| 427 | i = matchIndexes.length; |
| 428 | |
| 429 | // Match elements found at the specified indexes |
| 430 | while (i--) { |
| 431 | if (seed[(j = matchIndexes[i])]) { |
| 432 | seed[j] = !(matches[j] = seed[j]); |
| 433 | } |
| 434 | } |
| 435 | }); |
| 436 | }); |
| 437 | } |
| 438 | |
| 439 | /** |
| 440 | * Detect xml |
no test coverage detected