Skip to content

Commit

Permalink
docs: fix dead link
Browse files Browse the repository at this point in the history
  • Loading branch information
iann838 committed Nov 7, 2024
1 parent d23bd77 commit 342c37f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ hero:
actions:
- theme: brand
text: Get Started
link: /guides/first_steps.md
link: /guides/first-steps.md
- theme: alt
text: View Source
link: https://github.com/iann838/workery
Expand Down
2 changes: 1 addition & 1 deletion src/routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function generateRouteSummary(method: HTTPMethod, path: string): string {
...path
.split("/")
.map((s) => s && s[0].toUpperCase() + s.slice(1))
.filter((s) => s),
.filter((s) => s && !(s.startsWith("{") && s.endsWith("}"))),
].join(" ")
}

Expand Down
1 change: 1 addition & 0 deletions tests/routing.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ describe("function generateRouteSummary", () => {
expect(generateRouteSummary("GET", "path/to/route")).toBe("Read Path To Route")
expect(generateRouteSummary("POST", "/path/to/route/")).toBe("Create Path To Route")
expect(generateRouteSummary("PUT", "path/to/route/")).toBe("Update Path To Route")
expect(generateRouteSummary("PUT", "path/to/route/{id}")).toBe("Update Path To Route")
expect(generateRouteSummary("PATCH", "//route/")).toBe("Modify Route")
expect(generateRouteSummary("DELETE", "")).toBe("Delete")
})
Expand Down

0 comments on commit 342c37f

Please sign in to comment.