2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-06-22 17:30:33 +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] chunk = headObject[contentKeyName]
} }
if (isFunction(template)) { headObject[contentKeyName] = isFunction(template)
headObject[contentKeyName] = template.call(component, chunk) ? template.call(component, chunk)
} else { : template.replace(/%s/g, chunk)
headObject[contentKeyName] = template.replace(/%s/g, chunk)
}
return true return true
} }