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 { BYTE_ORDER_MARK } from '../consts.js';
/**
* Removes byte order mark (U+FEFF).
* @param input The string to normalize.
*
* @returns The normalized string.
*
* @example
*
* ```ts
* const normalized = normalizeByteOrderMark('\uFEFFHello'); // 'Hello'
* ```
*/
export function normalizeByteOrderMark(input) {
return input.replaceAll(BYTE_ORDER_MARK, '');
}