File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,12 @@ function injectFonts({
22
22
const deferedSpecs : string [ ] = [ ]
23
23
let links = ''
24
24
25
+ if ( ! Array . isArray ( families ) ) {
26
+ console . warn ( 'Google font families is required' )
27
+
28
+ return html
29
+ }
30
+
25
31
if ( families . length >= 0 ) {
26
32
for ( const family of families ) {
27
33
if ( typeof family === 'string' ) {
Original file line number Diff line number Diff line change @@ -11,6 +11,12 @@ function injectFonts({
11
11
} : TypeKitFonts , html : string ) : string {
12
12
let links = ''
13
13
14
+ if ( typeof id !== 'string' ) {
15
+ console . warn ( 'A Typekit id is required' )
16
+
17
+ return html
18
+ }
19
+
14
20
if ( defer )
15
21
links += `<link rel="preload" href="${ TypekitFontBase } ${ id } .css" as="style" onload="this.rel='stylesheet'">`
16
22
else
You can’t perform that action at this time.
0 commit comments