|
|
@ -21,13 +21,13 @@ async function readMarkdown(options: Options): Promise<Map<String, VueTag>> { |
|
|
|
return formatter(mdParser(fileContent), componentName, kebabComponentName, options.tagPrefix); |
|
|
|
return formatter(mdParser(fileContent), componentName, kebabComponentName, options.tagPrefix); |
|
|
|
}) |
|
|
|
}) |
|
|
|
.filter(item => item) as VueTag[][]; |
|
|
|
.filter(item => item) as VueTag[][]; |
|
|
|
const tags: Map<String, VueTag> = new Map(); |
|
|
|
const tags = new Map<String, VueTag>(); |
|
|
|
flatMap(data, item => item).forEach(mergedTag => mergeTag(tags, mergedTag)); |
|
|
|
flatMap(data, item => item).forEach(mergedTag => mergeTag(tags, mergedTag)); |
|
|
|
return tags; |
|
|
|
return tags; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function readTypings(options: Options): Map<String, VueTag> { |
|
|
|
function readTypings(options: Options): Map<String, VueTag> { |
|
|
|
const tags: Map<String, VueTag> = new Map(); |
|
|
|
const tags = new Map<String, VueTag>(); |
|
|
|
const fileContent = readFileSync(options.typingsPath, 'utf-8'); |
|
|
|
const fileContent = readFileSync(options.typingsPath, 'utf-8'); |
|
|
|
fileContent |
|
|
|
fileContent |
|
|
|
.split('\n') |
|
|
|
.split('\n') |
|
|
@ -61,7 +61,7 @@ function mergeTag(tags: Map<String, VueTag>, mergedTag: VueTag) { |
|
|
|
|
|
|
|
|
|
|
|
function mergeTags(mergedTagsArr: Map<String, VueTag>[]): VueTag[] { |
|
|
|
function mergeTags(mergedTagsArr: Map<String, VueTag>[]): VueTag[] { |
|
|
|
if (mergedTagsArr.length === 1) return [...mergedTagsArr[0].values()]; |
|
|
|
if (mergedTagsArr.length === 1) return [...mergedTagsArr[0].values()]; |
|
|
|
const tags: Map<String, VueTag> = new Map(); |
|
|
|
const tags = new Map<String, VueTag>(); |
|
|
|
if (mergedTagsArr.length === 0) return []; |
|
|
|
if (mergedTagsArr.length === 0) return []; |
|
|
|
mergedTagsArr.forEach(mergedTags => { |
|
|
|
mergedTagsArr.forEach(mergedTags => { |
|
|
|
mergedTags.forEach(mergedTag => mergeTag(tags, mergedTag)); |
|
|
|
mergedTags.forEach(mergedTag => mergeTag(tags, mergedTag)); |
|
|
|