Unicode Character Utility For JavaScript

Used to find the directionality, which is handled a bit differently than the other sets of properties since we need a value back, not just true/false. Returns one of the following:

  • UNDEFINED
  • L for LEFT_TO_RIGHT
  • R for RIGHT_TO_LEFT
  • AL for RIGHT_TO_LEFT_ARABIC
  • EN for EUROPEAN_NUMBER
  • ES for EUROPEAN_NUMBER_SEPARATOR
  • ET for EUROPEAN_NUMBER_TERMINATOR
  • AN for ARABIC_NUMBER
  • CS for COMMON_NUMBER_SEPARATOR
  • NSM for NONSPACING_MARK
  • BN for BOUNDARY_NEUTRAL
  • B for PARAGRAPH_SEPARATOR
  • S for SEGMENT_SEPARATOR
  • WS for WHITESPACE
  • ON for OTHER_NEUTRALS
  • LRE for LEFT_TO_RIGHT_EMBEDDING
  • LRO for LEFT_TO_RIGHT_OVERRIDE
  • RLE for RIGHT_TO_LEFT_EMBEDDING
  • RLO for RIGHT_TO_LEFT_OVERRIDE
  • PDF for POP_DIRECTIONAL_FORMAT

@param {String} string – a length 1 string

@returns {String} a string representing the directionality, as defined above