isWhitespace.js 203 B

1234567891011
  1. 'use strict';
  2. /**
  3. * Check if a character is whitespace.
  4. *
  5. * @param {string} char
  6. * @returns {boolean}
  7. */
  8. module.exports = function (char) {
  9. return [' ', '\n', '\t', '\r', '\f'].includes(char);
  10. };