mirror of
https://github.com/snachodog/just-the-docs.git
synced 2025-04-12 22:52:21 -06:00
19 lines
420 B
JavaScript
19 lines
420 B
JavaScript
/* @flow */
|
|
"use strict"
|
|
|
|
const isWhitespace = require("./isWhitespace")
|
|
|
|
/**
|
|
* Returns a Boolean indicating whether the the input string is only whitespace.
|
|
*/
|
|
module.exports = function (input/*: string*/)/*: boolean*/ {
|
|
let isOnlyWhitespace = true
|
|
for (let i = 0, l = input.length; i < l; i++) {
|
|
if (!isWhitespace(input[i])) {
|
|
isOnlyWhitespace = false
|
|
break
|
|
}
|
|
}
|
|
return isOnlyWhitespace
|
|
}
|