You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
448 B

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