All files tagoneline.js

100% Statements 6/6
100% Branches 0/0
100% Functions 1/1
100% Lines 6/6
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17          2x   2x 2x 2x     2x   1x    
// @flow
 
// tagged template outputing a one line string
// used to help logging
export default function tagOneLine (literals: any, ...substitutions: any) {
  let result = ''
 
  for (let i = 0; i < substitutions.length; i++) {
    result += literals[i].replace(/\n{1}\s+/, ' ')
    result += substitutions[i]
  }
 
  result += literals[literals.length - 1].replace(/\n{1}\s+/, ' ')
 
  return result
}