mirror of
https://github.com/OliveTin/OliveTin
synced 2025-12-18 20:15:38 +00:00
18 lines
338 B
JavaScript
18 lines
338 B
JavaScript
import isWhitespace from './isWhitespace.mjs';
|
|
|
|
/**
|
|
* Returns a Boolean indicating whether the input string is only whitespace.
|
|
*
|
|
* @param {string} input
|
|
* @returns {boolean}
|
|
*/
|
|
export default function isOnlyWhitespace(input) {
|
|
for (const element of input) {
|
|
if (!isWhitespace(element)) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
return true;
|
|
}
|