UNPKG

iframely

Version:

oEmbed/2 gateway endpoint. Get embed data for various http links through one self-hosted API

28 lines (22 loc) 614 B
export default { getMeta: function(meta) { function getAuthor(value) { if (typeof value === "string") { if (/^https?:\/\//i.test(value)) { return { author_url: value }; } else { return { author: value }; } } } var result = getAuthor(meta.author); if (!result && meta.article) { result = getAuthor(meta.article.author); } return result; } };