2
0
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:
Fredrik Nordström
2018-11-14 20:35:41 +01:00
parent 0ac5d5b051
commit 230bd9d152
2 changed files with 1270 additions and 396 deletions
+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) => {
+1269 -396
View File
File diff suppressed because it is too large Load Diff