rittenhop-dev/versions/5.94.2/node_modules/is-whitespace-character/index.js
2024-09-23 19:40:12 -04:00

15 lines
342 B
JavaScript

'use strict'
module.exports = whitespace
var fromCode = String.fromCharCode
var re = /\s/
// Check if the given character code, or the character code at the first
// character, is a whitespace character.
function whitespace(character) {
return re.test(
typeof character === 'number' ? fromCode(character) : character.charAt(0)
)
}