2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-05-31 00:34:04 +03:00

refactor: prefer ternary

This commit is contained in:
pimlie
2019-03-08 17:04:41 +01:00
committed by Alexander Lichter
parent 6f1b080654
commit 9d8ea758ac
+4 -5
View File
@@ -15,10 +15,9 @@ export default function applyTemplate({ component, metaTemplateKeyName, contentK
chunk = headObject[contentKeyName]
}
if (isFunction(template)) {
headObject[contentKeyName] = template.call(component, chunk)
} else {
headObject[contentKeyName] = template.replace(/%s/g, chunk)
}
headObject[contentKeyName] = isFunction(template)
? template.call(component, chunk)
: template.replace(/%s/g, chunk)
return true
}