github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/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.replace(/\n/g, '').replace(/ +/g, ' ').trim(); 5 }