UNPKG

openapi3-generator

Version:

Use your API OpenAPI 3 definition to generate code, documentation, and literally anything you need.

11 lines (8 loc) 283 B
const Handlebars = require('handlebars'); Handlebars.registerHelper('tree', path => { if (!path) return ''; const filteredPaths = path.split('.').filter(Boolean); if (!filteredPaths.length) return; const dottedPath = filteredPaths.join('.'); return `${dottedPath}.`; });