Files
sgauthier 6e64e138e2
All checks were successful
Publish To Prod / deploy_and_publish (push) Successful in 35s
planning
2024-10-14 09:15:30 +02: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)
)
}