vuoto
Version:
Modern whitespace normalizer CLI with enhanced output and developer experience - cut the noise, clean the void
17 lines (16 loc) • 378 B
JavaScript
import { EM_SPACE } from '../consts.js';
/**
* Replaces em space (U+2003) with a normal space.
* @param input The string to normalize.
*
* @returns The normalized string.
*
* @example
*
* ```ts
* const normalized = normalizeEmSpace('Hello\u2003World'); // 'Hello World'
* ```
*/
export function normalizeEmSpace(input) {
return input.replaceAll(EM_SPACE, ' ');
}