const stripQuotes = (fontFamily) => fontFamily.trim().replace(/^['"]|['"]$/g, "");
const splitFontFamilies = (fontFamily) => fontFamily.split(",").map((token) => token.trim()).filter(Boolean);
const hasFallbackFontFamily = (fontFamily, fallbackFontFamily) => splitFontFamilies(fontFamily).some(
  (token) => stripQuotes(token) === stripQuotes(fallbackFontFamily)
);
const withFallbackFontFamily = (fontFamily, fallbackFontFamily) => {
  if (!fontFamily || !fallbackFontFamily || hasFallbackFontFamily(fontFamily, fallbackFontFamily)) {
    return fontFamily;
  }
  return `${fontFamily}, ${fallbackFontFamily}`;
};
export {
  withFallbackFontFamily
};
//# sourceMappingURL=with-fallback-font-family.js.map
