MCPcopy Create free account
hub / github.com/DavidWells/analytics / sortPlugins

Function sortPlugins

scripts/docs.js:231–240  ·  view source on GitHub ↗
(one, two)

Source from the content-addressed store, hash-verified

229const SORT_REGEX = /(?:(?:^|-)analytics-plugin(?:-|$))|(?:(?:^|-)analytics(?:-|$))/
230/* Utils functions */
231function sortPlugins(one, two) {
232 // console.log('a', a)
233 const [ , a] = one
234 const [ , b] = two
235 const aName = a.name.toLowerCase()
236 const aNameClean = aName.replace(SORT_REGEX, '')
237 const bName = b.name.toLowerCase()
238 const bNameClean = bName.replace(SORT_REGEX, '')
239 return aNameClean.localeCompare(bNameClean) || aName.localeCompare(bName)
240}
241
242async function mainUsageBlock(primaryExample, allData) {
243 const { data, pkg } = primaryExample

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected