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 { EN_SPACE } from '../consts.js';
/**
* Replaces en space (U+2002) with a normal space.
* @param input The string to normalize.
*
* @returns The normalized string.
*
* @example
*
* ```ts
* const normalized = normalizeEnSpace('Hello\u2002World'); // 'Hello World'
* ```
*/
export function normalizeEnSpace(input) {
return input.replaceAll(EN_SPACE, ' ');
}