route-types.ejs 503 B

123456789101112131415161718
  1. <%
  2. const { utils, config, route, modelTypes } = it;
  3. const { _, pascalCase } = utils;
  4. const { routes, moduleName } = route;
  5. const dataContracts = config.modular ? _.map(modelTypes, "name") : [];
  6. %>
  7. <% if (dataContracts.length) { %>
  8. import { <%~ dataContracts.join(", ") %> } from "./<%~ config.fileNames.dataContracts %>"
  9. <% } %>
  10. export namespace <%~ pascalCase(moduleName) %> {
  11. <% _.forEach(routes, (route) => { %>
  12. <%~ includeFile('./route-type.ejs', { ...it, route }) %>
  13. <% }) %>
  14. }