• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/**
2 * @author Toru Nagashima <https://github.com/mysticatea>
3 */
4"use strict";
5
6/**
7 * Check whether given two characters are a surrogate pair.
8 * @param {number} lead The code of the lead character.
9 * @param {number} tail The code of the tail character.
10 * @returns {boolean} `true` if the character pair is a surrogate pair.
11 */
12module.exports = function isSurrogatePair(lead, tail) {
13    return lead >= 0xD800 && lead < 0xDC00 && tail >= 0xDC00 && tail < 0xE000;
14};
15