(data, pkg)
| 517 | |
| 518 | // ${example.replace(/^\s+|\s+$/g, '')}, |
| 519 | function es6Usage(data, pkg) { |
| 520 | const main = data.jsdoc.find((doc) => Boolean(doc.examples)) |
| 521 | |
| 522 | const name = main.name |
| 523 | const exampleCode = main.examples[0] |
| 524 | const code = ` |
| 525 | ${generateImportStatement(name, pkg.name)} |
| 526 | |
| 527 | const analytics = Analytics({ |
| 528 | app: 'awesome-app', |
| 529 | plugins: [ |
| 530 | ${exampleCode} |
| 531 | // ...other plugins |
| 532 | ] |
| 533 | }) |
| 534 | |
| 535 | ${renderRelevantMethods(data)} |
| 536 | ` |
| 537 | |
| 538 | return `<details> |
| 539 | <summary>Server-side ES6</summary> |
| 540 | |
| 541 | \`\`\`js |
| 542 | ${indentString(formatCode(code), 2)} |
| 543 | \`\`\` |
| 544 | |
| 545 | </details> |
| 546 | ` |
| 547 | } |
| 548 | |
| 549 | function getExposedFunctions(data) { |
| 550 | return data.ast.methodsByName.filter(removeMethod) |
no test coverage detected