All files / app/assets/javascripts/emoji/support index.js

0% Statements 0/4
0% Branches 0/7
0% Functions 0/1
0% Lines 0/4

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19                                     
import isEmojiUnicodeSupported from './is_emoji_unicode_supported';
import getUnicodeSupportMap from './unicode_support_map';
 
// cache browser support map between calls
let browserUnicodeSupportMap;
 
export default function isEmojiUnicodeSupportedByBrowser(emojiUnicode, unicodeVersion) {
  // Skipping the map creation for Bots + RSPec
  if (
    navigator.userAgent.indexOf('HeadlessChrome') > -1 ||
    navigator.userAgent.indexOf('Lighthouse') > -1 ||
    navigator.userAgent.indexOf('Speedindex') > -1
  ) {
    return true;
  }
  browserUnicodeSupportMap = browserUnicodeSupportMap || getUnicodeSupportMap();
  return isEmojiUnicodeSupported(browserUnicodeSupportMap, emojiUnicode, unicodeVersion);
}