UNPKG

284 BTypeScriptView Raw
1/**
2Check if a string has [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code).
3
4@example
5```
6import hasAnsi from 'has-ansi';
7
8hasAnsi('\u001B[4mUnicorn\u001B[0m');
9//=> true
10
11hasAnsi('cake');
12//=> false
13```
14*/
15export default function hasAnsi(string: string): boolean;