github.com/Ilhicas/nomad@v1.0.4-0.20210304152020-e86851182bc3/ui/tests/utils/clean-whitespace.js (about) 1 // cleans whitespace from a string, for example for cleaning 2 // textContent in DOM nodes with indentation 3 export default function cleanWhitespace(string) { 4 return string 5 .replace(/\n/g, '') 6 .replace(/ +/g, ' ') 7 .trim(); 8 }