1 /** Used to compose unicode character classes. */
2 var rsAstralRange = '\\ud800-\\udfff',
3 rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23',
4 rsComboSymbolsRange = '\\u20d0-\\u20f0',
5 rsVarRange = '\\ufe0e\\ufe0f';
7 /** Used to compose unicode capture groups. */
10 /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
11 var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']');
14 * Checks if `string` contains Unicode symbols.
17 * @param {string} string The string to inspect.
18 * @returns {boolean} Returns `true` if a symbol is found, else `false`.
20 function hasUnicode(string) {
21 return reHasUnicode.test(string);
24 module.exports = hasUnicode;