blob: 8c3537f99568c35a27e740abf3ee10f1a6851496 [file] [log] [blame]
'use strict'
module.exports = wordCharacter
var fromCode = String.fromCharCode
var re = /\w/
// Check if the given character code, or the character code at the first
// character, is a word character.
function wordCharacter(character) {
return re.test(
typeof character === 'number' ? fromCode(character) : character.charAt(0)
)
}