(functions: VueUseFunction[], title = true)
| 106 | } |
| 107 | |
| 108 | export function stringifyFunctions(functions: VueUseFunction[], title = true) { |
| 109 | let list = '' |
| 110 | |
| 111 | const categories = getCategories(functions) |
| 112 | |
| 113 | for (const category of categories) { |
| 114 | if (category.startsWith('_')) |
| 115 | continue |
| 116 | |
| 117 | if (title) |
| 118 | list += `### ${category}\n` |
| 119 | |
| 120 | const categoryFunctions = functions |
| 121 | .filter(i => i.category === category) |
| 122 | .sort((a, b) => a.name.localeCompare(b.name)) |
| 123 | |
| 124 | for (const { name, docs, description, deprecated } of categoryFunctions) { |
| 125 | if (deprecated) |
| 126 | continue |
| 127 | |
| 128 | const desc = description ? ` — ${description}` : '' |
| 129 | list += `- [\`${name}\`](${docs})${desc}\n` |
| 130 | } |
| 131 | list += '\n' |
| 132 | } |
| 133 | return list |
| 134 | } |
| 135 | |
| 136 | export function replacer(code: string, value: string, key: string, insert: 'head' | 'tail' | 'none' = 'none') { |
| 137 | const START = `<!--${key}_STARTS-->` |
no test coverage detected