UNPKG

448 BJavaScriptView Raw
1import asciiToArray from './_asciiToArray.js';
2import hasUnicode from './_hasUnicode.js';
3import unicodeToArray from './_unicodeToArray.js';
4
5/**
6 * Converts `string` to an array.
7 *
8 * @private
9 * @param {string} string The string to convert.
10 * @returns {Array} Returns the converted array.
11 */
12function stringToArray(string) {
13 return hasUnicode(string)
14 ? unicodeToArray(string)
15 : asciiToArray(string);
16}
17
18export default stringToArray;