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:
committed by
Alexander Lichter
parent
6f1b080654
commit
9d8ea758ac
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user