blob: fd47d214ac3ca8ff422a36b0d5a69fe43b708a27 [file] [log] [blame]
'use strict';
const isWhitespace = require('./isWhitespace');
/**
* Returns a Boolean indicating whether the the input string is only whitespace.
*
* @param {string} input
* @returns {boolean}
*/
module.exports = function (input) {
let isOnlyWhitespace = true;
for (const element of input) {
if (!isWhitespace(element)) {
isOnlyWhitespace = false;
break;
}
}
return isOnlyWhitespace;
};