(label: string)
| 94 | // Given a label, return a function which given a string, |
| 95 | // right-aligns it preceding the colon in the label. |
| 96 | const getRightAlignedPrinter = (label: string): PrintLabel => { |
| 97 | // Assume that the label contains a colon. |
| 98 | const index = label.indexOf(':'); |
| 99 | const suffix = label.slice(index); |
| 100 | |
| 101 | return (string: string, isExpectedCall: boolean) => |
| 102 | (isExpectedCall |
| 103 | ? `->${' '.repeat(Math.max(0, index - 2 - string.length))}` |
| 104 | : ' '.repeat(Math.max(index - string.length))) + |
| 105 | string + |
| 106 | suffix; |
| 107 | }; |
| 108 | |
| 109 | type IndexedCall = [number, Array<unknown>]; |
| 110 |
no outgoing calls
no test coverage detected