isOnlyWhitespace.cjs 522 B

1234567891011121314151617181920212223
  1. // NOTICE: This file is generated by Rollup. To modify it,
  2. // please instead edit the ESM counterpart and rebuild with Rollup (npm run build).
  3. 'use strict';
  4. const isWhitespace = require('./isWhitespace.cjs');
  5. /**
  6. * Returns a Boolean indicating whether the input string is only whitespace.
  7. *
  8. * @param {string} input
  9. * @returns {boolean}
  10. */
  11. function isOnlyWhitespace(input) {
  12. for (const element of input) {
  13. if (!isWhitespace(element)) {
  14. return false;
  15. }
  16. }
  17. return true;
  18. }
  19. module.exports = isOnlyWhitespace;