b65977f7a3b4ea0f15edaca4512859929c9be4b11cc73cc31b18431dcddd5887f34a856627b97e11a4dc36e05049e5ba6e9800d960818b904e777570be48e4 432 B

123456789101112131415161718
  1. var asciiSize = require('./_asciiSize'),
  2. hasUnicode = require('./_hasUnicode'),
  3. unicodeSize = require('./_unicodeSize');
  4. /**
  5. * Gets the number of symbols in `string`.
  6. *
  7. * @private
  8. * @param {string} string The string to inspect.
  9. * @returns {number} Returns the string size.
  10. */
  11. function stringSize(string) {
  12. return hasUnicode(string)
  13. ? unicodeSize(string)
  14. : asciiSize(string);
  15. }
  16. module.exports = stringSize;