isSpace.js 639 B

1234567891011121314
  1. /**
  2. * Used by `trimmedLeftIndex` and `trimmedRightIndex` to determine if a
  3. * character code is whitespace.
  4. *
  5. * @private
  6. * @param {number} charCode The character code to inspect.
  7. * @returns {boolean} Returns `true` if `charCode` is whitespace, else `false`.
  8. */
  9. function isSpace(charCode) {
  10. return ((charCode <= 160 && (charCode >= 9 && charCode <= 13) || charCode == 32 || charCode == 160) || charCode == 5760 || charCode == 6158 ||
  11. (charCode >= 8192 && (charCode <= 8202 || charCode == 8232 || charCode == 8233 || charCode == 8239 || charCode == 8287 || charCode == 12288 || charCode == 65279)));
  12. }
  13. module.exports = isSpace;