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

Function getUsageExamples

scripts/docs.js:365–393  ·  view source on GitHub ↗
(d)

Source from the content-addressed store, hash-verified

363}
364
365async function getUsageExamples(d) {
366 const { data, pkg, platform, dir } = d
367 if (platform === 'node') {
368 return [{
369 name: 'es6node',
370 order: 1,
371 text: es6Usage(data, pkg)
372 },
373 {
374 name: 'node',
375 order: 2,
376 text: nodeUsage(data, pkg)
377 }]
378 } else {
379 const esmHtml = browserESMUsage(data, pkg)
380 const vanillaHtml = await browserStandaloneUsage(data, pkg, dir)
381
382 return [{
383 name: 'esHtml',
384 order: 4,
385 text: esmHtml
386 },
387 {
388 name: 'html',
389 order: 3,
390 text: vanillaHtml
391 }]
392 }
393}
394
395function getPlatforms(allData) {
396 return allData.map((d) => {

Callers 1

mainUsageBlockFunction · 0.85

Calls 4

es6UsageFunction · 0.85
nodeUsageFunction · 0.85
browserESMUsageFunction · 0.85
browserStandaloneUsageFunction · 0.85

Tested by

no test coverage detected