MCPcopy Create free account
hub / github.com/cn-docs/vueuse / stringifyFunctions

Function stringifyFunctions

scripts/utils.ts:108–134  ·  view source on GitHub ↗
(functions: VueUseFunction[], title = true)

Source from the content-addressed store, hash-verified

106}
107
108export 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
136export function replacer(code: string, value: string, key: string, insert: 'head' | 'tail' | 'none' = 'none') {
137 const START = `<!--${key}_STARTS-->`

Callers 2

updatePackageREADMEFunction · 0.85
updateFunctionsMDFunction · 0.85

Calls 1

getCategoriesFunction · 0.90

Tested by

no test coverage detected