(keyA: any, keyB: any)
| 42 | } |
| 43 | |
| 44 | private compareSortKeys(keyA: any, keyB: any): number { |
| 45 | if (Array.isArray(keyA) && Array.isArray(keyB)) { |
| 46 | // Compare list (tuple equivalent) values |
| 47 | for (let i = 0; i < Math.min(keyA.length, keyB.length); i++) { |
| 48 | if (keyA[i] < keyB[i]) { |
| 49 | return this.reverse ? 1 : -1; |
| 50 | } else if (keyA[i] > keyB[i]) { |
| 51 | return this.reverse ? -1 : 1; |
| 52 | } |
| 53 | } |
| 54 | return this.reverse ? keyB.length - keyA.length : keyA.length - keyB.length; |
| 55 | } |
| 56 | |
| 57 | // Compare other types of values |
| 58 | if (keyA < keyB) { |
| 59 | return this.reverse ? 1 : -1; |
| 60 | } else if (keyA > keyB) { |
| 61 | return this.reverse ? -1 : 1; |
| 62 | } else { |
| 63 | return 0; |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | public apply(data: any[]): any[] { |
| 68 | const copy = [...data]; |
nothing calls this directly
no outgoing calls
no test coverage detected