Throw for featured apps not array

This commit is contained in:
Sam Carlton 2022-06-09 13:18:35 -05:00
parent 6a9a3edb5d
commit d755c6485d

View file

@ -5,6 +5,12 @@ function makeFeaturedAppsString ( featuredApps ) {
export function buildVideoStructuredData ( video, featuredApps, options ) {
// console.log('video', video)
// Throw for missing featured apps
if ( Array.isArray(featuredApps) === false ) {
console.warn( 'featuredApps not array', featuredApps )
throw new Error('featuredApps must be an array of objects')
}
const {
siteUrl
} = options