mirror of
https://github.com/tenrok/vue-meta.git
synced 2026-06-22 19:40:36 +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]
|
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
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user