vuoto
Version:
Modern whitespace normalizer CLI with enhanced output and developer experience - cut the noise, clean the void
17 lines (16 loc) • 381 B
JavaScript
import { ZERO_WIDTH } from '../consts.js';
/**
* Removes zero-width and invisible characters.
* @param input The string to normalize.
*
* @returns The normalized string.
*
* @example
*
* ```ts
* const normalized = normalizeZeroWidth('Hello\u200BWorld'); // 'HelloWorld'
* ```
*/
export function normalizeZeroWidth(input) {
return input.replaceAll(ZERO_WIDTH, '');
}