mirror of
https://github.com/kemko/nomad.git
synced 2026-01-03 08:55:43 +03:00
11 lines
300 B
JavaScript
11 lines
300 B
JavaScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
// cleans whitespace from a string, for example for cleaning
|
|
// textContent in DOM nodes with indentation
|
|
export default function cleanWhitespace(string) {
|
|
return string.replace(/\n/g, '').replace(/ +/g, ' ').trim();
|
|
}
|