Sha256: 79eaf1570bb18732be65875ef7fd233b8aac09402d1b905b75bfeed06478a843

Contents?: true

Size: 1.55 KB

Versions: 270

Compression:

Stored size: 1.55 KB

Contents

/** Used to compose unicode character classes. */
var rsAstralRange = '\\ud800-\\udfff',
    rsComboMarksRange = '\\u0300-\\u036f',
    reComboHalfMarksRange = '\\ufe20-\\ufe2f',
    rsComboSymbolsRange = '\\u20d0-\\u20ff',
    rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
    rsVarRange = '\\ufe0e\\ufe0f';

/** Used to compose unicode capture groups. */
var rsAstral = '[' + rsAstralRange + ']',
    rsCombo = '[' + rsComboRange + ']',
    rsFitz = '\\ud83c[\\udffb-\\udfff]',
    rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
    rsNonAstral = '[^' + rsAstralRange + ']',
    rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
    rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
    rsZWJ = '\\u200d';

/** Used to compose unicode regexes. */
var reOptMod = rsModifier + '?',
    rsOptVar = '[' + rsVarRange + ']?',
    rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
    rsSeq = rsOptVar + reOptMod + rsOptJoin,
    rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';

/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');

/**
 * Converts a Unicode `string` to an array.
 *
 * @private
 * @param {string} string The string to convert.
 * @returns {Array} Returns the converted array.
 */
function unicodeToArray(string) {
  return string.match(reUnicode) || [];
}

module.exports = unicodeToArray;

Version data entries

270 entries across 269 versions & 28 rubygems

Version Path
disco_app-0.18.2 test/dummy/node_modules/lodash/_unicodeToArray.js
sumomo-0.8.15 data/sumomo/api_modules/node_modules/lodash/_unicodeToArray.js
trusty-cms-5.0.7 node_modules/lodash/_unicodeToArray.js
appmap-0.72.2 ./node_modules/lodash/_unicodeToArray.js
trusty-cms-5.0.6 node_modules/lodash/_unicodeToArray.js
appmap-0.72.1 ./node_modules/lodash/_unicodeToArray.js
appmap-0.72.0 ./node_modules/lodash/_unicodeToArray.js
trusty-cms-5.0.5 node_modules/lodash/_unicodeToArray.js
trusty-cms-5.0.4 node_modules/lodash/_unicodeToArray.js
appmap-0.71.0 ./node_modules/lodash/_unicodeToArray.js
disco_app-0.16.1 test/dummy/node_modules/lodash/_unicodeToArray.js
appmap-0.70.2 ./node_modules/lodash/_unicodeToArray.js
sumomo-0.8.14 data/sumomo/api_modules/node_modules/lodash/_unicodeToArray.js
appmap-0.70.1 ./node_modules/lodash/_unicodeToArray.js
appmap-0.70.0 ./node_modules/lodash/_unicodeToArray.js
appmap-0.69.0 ./node_modules/lodash/_unicodeToArray.js
sumomo-0.8.13 data/sumomo/api_modules/node_modules/lodash/_unicodeToArray.js
appmap-0.68.2 ./node_modules/lodash/_unicodeToArray.js
appmap-0.68.1 ./node_modules/lodash/_unicodeToArray.js
disco_app-0.15.2 test/dummy/node_modules/lodash/_unicodeToArray.js