docs: function bmpCharAt(str, index) {
    const s = str + '';
    let i = index;
    const end = s.length;
  
    const pairs = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
    while (pairs.exec(s)) {
      const li = pairs.lastIndex;
      if (li - 2 < i) {
        i++;
      } else {
        break;
      }
    }
  
    if (i >= end || i < 0) {
      return '';
    }
  
    let result = s.charAt(i);
  
    if (/[\uD800-\uDBFF]/.test(result) && /[\uDC00-\uDFFF]/.test(s.charAt(i + 1))) {
      result += s.charAt(i + 1);
    }
  
    return result;
  }