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 19 20 21 | 22x 22x 22x 26x 26x 22x | import auto from './auto.js'
import raw from './raw.js'
import type S from './sanitised.js'
/**
* @returns space delimited line constructed from provided elements.
*
* `undefined` values are filtered out.
*
* Empty list returns sanitized empty string.
*
* @see maybeLine for variant which propagates emtpy list to undefined.
*/
export const line =
(...elements: unknown[]): S => {
const elements_ = elements.filter(_ => typeof _ !== 'undefined')
return raw(elements_.map(auto).map(_ => _.toString().trim()).join(' '))
}
export default line
|