1
0
mirror of https://github.com/thangisme/notes.git synced 2024-06-11 23:01:12 +00:00
notes/node_modules/stylelint/lib/utils/isOnlyWhitespace.js
Patrick Marsceill b7b0d0d7bf
Initial commit
2017-03-09 13:16:08 -05:00

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
}