2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-06-07 04:52:24 +03:00

Merge pull request #286 from Livog/master

Bail on empty objects sent to the tagGenerator function
This commit is contained in:
Sébastien Chopin
2018-11-26 14:09:19 +01:00
committed by GitHub
+1
View File
@@ -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) => {