Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | 22x 22x 5x 5x 2x 3x 22x | import maybeLines from './maybe-lines.js'
import type S from './sanitised.js'
/**
* @returns lines joined with provided separator.
* @throws if there are no lines on output.
*/
export const lines =
<T>(inputs: readonly T[], separator = '\n'): S => {
const output = maybeLines(inputs, separator)
if (typeof output === 'undefined') {
throw new Error('Expected at least one line.')
}
return output
}
export default lines
|