Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature small changes #8

Merged
merged 5 commits into from
Jan 11, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert "chore: remove unused console.log"
This reverts commit 80da08e.
  • Loading branch information
Francisco committed Jan 10, 2023
commit 1f9908d6655f3739aff995106d2c7c332f8f0087
6 changes: 6 additions & 0 deletions src/printer.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ export const printRoutes = (routesMap, options) => {
.flat().length;

for (const [index, route] of sortedRoutes.entries()) {
if (options.group) {
const basePath = `/${route.split('/')[1]}`;
const isGroupBreak =
index > 0 && !sortedRoutes[index - 1]?.startsWith(basePath);
if (isGroupBreak) console.log();
}

if (canPrintRoute('GET', route)) printRoute('GET', route);
if (canPrintRoute('POST', route)) printRoute('POST', route);
Expand Down