Skip to content

Commit

Permalink
improve syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
matiasbenedetto committed Sep 9, 2024
1 parent 0bed01d commit 48bfe65
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,10 @@ function formatFontFaceName( input ) {
* It also adds it to the iframe document.
*/
export async function loadFontFaceInBrowser( fontFace, source, addTo = 'all' ) {
let dataSource;

if ( typeof source === 'string' ) {
dataSource = `url(${ source })`;
// eslint-disable-next-line no-undef
} else {
if ( typeof source !== 'string' ) {
return;
}

const dataSource = `url(${ source })`;
const newFont = new window.FontFace(
formatFontFaceName( fontFace.fontFamily ),
dataSource,
Expand Down

0 comments on commit 48bfe65

Please sign in to comment.