(compare = ascending$3)
| 564 | } |
| 565 | |
| 566 | function compareDefined(compare = ascending$3) { |
| 567 | if (compare === ascending$3) return ascendingDefined; |
| 568 | if (typeof compare !== "function") throw new TypeError("compare is not a function"); |
| 569 | return (a, b) => { |
| 570 | const x = compare(a, b); |
| 571 | if (x || x === 0) return x; |
| 572 | return (compare(b, b) === 0) - (compare(a, a) === 0); |
| 573 | }; |
| 574 | } |
| 575 | |
| 576 | function ascendingDefined(a, b) { |
| 577 | return (a == null || !(a >= a)) - (b == null || !(b >= b)) || (a < b ? -1 : a > b ? 1 : 0); |
no outgoing calls
no test coverage detected