Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
if (data[context].primary_author.facebook) {
sameAs.push(socialUrls.facebook(data[context].primary_author.facebook));
}
if (data[context].primary_author.twitter) {
sameAs.push(socialUrls.twitter(data[context].primary_author.twitter));
}
} else if (context === 'author') {
if (data.author.website) {
sameAs.push(escapeExpression(data.author.website));
}
if (data.author.facebook) {
sameAs.push(socialUrls.facebook(data.author.facebook));
}
if (data.author.twitter) {
sameAs.push(socialUrls.twitter(data.author.twitter));
}
}
return sameAs;
}
function trimSameAs(data, context) {
var sameAs = [];
if (context === 'post' || context === 'page') {
if (data[context].primary_author.website) {
sameAs.push(escapeExpression(data[context].primary_author.website));
}
if (data[context].primary_author.facebook) {
sameAs.push(socialUrls.facebook(data[context].primary_author.facebook));
}
if (data[context].primary_author.twitter) {
sameAs.push(socialUrls.twitter(data[context].primary_author.twitter));
}
} else if (context === 'author') {
if (data.author.website) {
sameAs.push(escapeExpression(data.author.website));
}
if (data.author.facebook) {
sameAs.push(socialUrls.facebook(data.author.facebook));
}
if (data.author.twitter) {
sameAs.push(socialUrls.twitter(data.author.twitter));
}
}
return sameAs;
}