vuoto
Version:
Modern whitespace normalizer CLI with enhanced output and developer experience - cut the noise, clean the void
17 lines (16 loc) • 438 B
JavaScript
import { VISIBLE_MISC_SPACES } from '../consts.js';
/**
* Replaces various visible miscellaneous spaces with normal spaces.
* @param input The string to normalize.
*
* @returns The normalized string.
*
* @example
*
* ```ts
* const normalized = normalizeVisibleMiscSpaces('Hello\u2004World'); // 'Hello World'
* ```
*/
export function normalizeVisibleMiscSpaces(input) {
return input.replaceAll(VISIBLE_MISC_SPACES, ' ');
}