UNPKG

310 BJavaScriptView Raw
1import { ANSI_G, ASTRAL_G, ANSI, ASTRAL } from '@spare/regex-charset';
2
3const clearAnsi = tx => tx.replace(ANSI_G, '');
4
5const clearAstral = tx => tx.replace(ASTRAL_G, '_');
6
7const hasAnsi = tx => ANSI.test(tx);
8
9const hasAstral = tx => ASTRAL.test(tx);
10
11export { clearAnsi, clearAstral, hasAnsi, hasAstral };