2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-06-14 18:32:24 +03:00

refactor: just pass all options to getComponentOption

This commit is contained in:
pimlie
2019-03-08 18:08:19 +01:00
committed by Alexander Lichter
parent c9a732c9d7
commit da4bb27a4b
+3 -9
View File
@@ -11,15 +11,9 @@ import getComponentOption from './getComponentOption'
* @param {Object} component - the Vue instance to get meta info from
* @return {Object} - returned meta info
*/
export default function getMetaInfo({ keyName, tagIDKeyName, metaTemplateKeyName, contentKeyName } = {}, component, escapeSequences = []) {
export default function getMetaInfo(options = {}, component, escapeSequences = []) {
// collect & aggregate all metaInfo $options
let info = getComponentOption({
component,
keyName,
metaTemplateKeyName,
tagIDKeyName,
contentKeyName
}, defaultInfo)
let info = getComponentOption({ ...options, component }, defaultInfo)
// Remove all "template" tags from meta
@@ -53,7 +47,7 @@ export default function getMetaInfo({ keyName, tagIDKeyName, metaTemplateKeyName
}
// begin sanitization
info = escape(info, { tagIDKeyName }, escapeSequences)
info = escape(info, options, escapeSequences)
return info
}