* Helper function to sort results by key and then index
(results: Array<any>)
| 436 | * Helper function to sort results by key and then index |
| 437 | */ |
| 438 | function sortByKeyAndIndex(results: Array<any>) { |
| 439 | return [...results] |
| 440 | .sort( |
| 441 | ( |
| 442 | [[_aKey, [_aValue, _aIndex]], aMultiplicity], |
| 443 | [[_bKey, [_bValue, _bIndex]], bMultiplicity], |
| 444 | ) => aMultiplicity - bMultiplicity, |
| 445 | ) |
| 446 | .sort( |
| 447 | ( |
| 448 | [[aKey, [_aValue, _aIndex]], _aMultiplicity], |
| 449 | [[bKey, [_bValue, _bIndex]], _bMultiplicity], |
| 450 | ) => aKey - bKey, |
| 451 | ) |
| 452 | .sort( |
| 453 | ( |
| 454 | [[_aKey, [_aValue, _aIndex]], _aMultiplicity], |
| 455 | [[_bKey, [_bValue, _bIndex]], _bMultiplicity], |
| 456 | ) => _aIndex - _bIndex, |
| 457 | ) |
| 458 | } |
no outgoing calls
no test coverage detected