Initial commit
[yaffs-website] / node_modules / grunt-contrib-watch / node_modules / globule / node_modules / lodash / _hasUnicode.js
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';
6
7 /** Used to compose unicode capture groups. */
8 var rsZWJ = '\\u200d';
9
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 + ']');
12
13 /**
14  * Checks if `string` contains Unicode symbols.
15  *
16  * @private
17  * @param {string} string The string to inspect.
18  * @returns {boolean} Returns `true` if a symbol is found, else `false`.
19  */
20 function hasUnicode(string) {
21   return reHasUnicode.test(string);
22 }
23
24 module.exports = hasUnicode;