modules/layers/src/text-layer/font-atlas-manager.js
function getNewChars(key, characterSet) {
  const cachedFontAtlas = cache.get(key);
  if (!cachedFontAtlas) {
    return characterSet;
  }

  const newChars = [];
  const cachedMapping = cachedFontAtlas.mapping;
  let cachedCharSet = Object.keys(cachedMapping);
  cachedCharSet = new Set(cachedCharSet);

  let charSet = characterSet;
  if (charSet instanceof Array) {
    charSet = new Set(charSet);
  }

  charSet.forEach(char => {
    if (!cachedCharSet.has(char)) {
      newChars.push(char);
    }
  });

  return newChars;
}
function getNewChars(key, characterSet) {
  const cachedFontAtlas = cache.get(key);
  if (!cachedFontAtlas) {
    return characterSet;
  }

  const newChars = [];
  const cachedMapping = cachedFontAtlas.mapping;
  let cachedCharSet = Object.keys(cachedMapping);
  cachedCharSet = new Set(cachedCharSet);

  let charSet = characterSet;
  if (charSet instanceof Array) {
    charSet = new Set(charSet);
  }

  charSet.forEach(char => {
    if (!cachedCharSet.has(char)) {
      newChars.push(char);
    }
  });

  return newChars;
}
function getNewChars ( key , characterSet ) { const cachedFontAtlas = cache . get ( key ) ; if ( ! cachedFontAtlas ) { return characterSet ; } const newChars = [ ] ; const cachedMapping = cachedFontAtlas . mapping ; let cachedCharSet = Object . keys ( cachedMapping ) ; cachedCharSet = new Set ( cachedCharSet ) ; let charSet = characterSet ; if ( charSet instanceof Array ) { charSet = new Set ( charSet ) ; } charSet . forEach ( char => { if ( ! cachedCharSet . has ( char ) ) { newChars . push ( char ) ; } } ) ; return newChars ; }
get all the chars not in cache
@param key cache key
@param characterSet (Array|Set)
@returns {Array} chars not in cache
get all the chars not in cache