mirror of
https://github.com/tenrok/vue-meta.git
synced 2026-06-05 11:32:25 +03:00
Bail on empty objects sent to the tagGenerator function
This commit is contained in:
@@ -13,6 +13,7 @@ export default function _tagGenerator (options = {}) {
|
||||
text ({ body = false } = {}) {
|
||||
// build a string containing all tags of this type
|
||||
return tags.reduce((tagsStr, tag) => {
|
||||
if (Object.keys(tag).length === 0) return tagsStr // Bail on empty tag object
|
||||
if (!!tag.body !== body) return tagsStr
|
||||
// build a string containing all attributes of this tag
|
||||
const attrs = Object.keys(tag).reduce((attrsStr, attr) => {
|
||||
|
||||
Reference in New Issue
Block a user