Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

is-surrogate-pair.js 471B

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