Skip to content

Commit

Permalink
fix: path param default route summary
Browse files Browse the repository at this point in the history
  • Loading branch information
iann838 committed Nov 7, 2024
1 parent 342c37f commit 8daec5f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/.vitepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default {
activeMatch: "/reference/*"
},
{
text: "1.1.1 (latest)",
text: "1.1.2 (latest)",
items: [
{ text: "Releases", link: "https://github.com/iann838/workery/releases" },
{ text: "Migrations", link: "/migrations/1_0-1_1.md" }
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/code-duplication.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Code Duplication

If you notice that your code is starting to repeat statements and declaration more than a few times, it is probably time to address them.
If you notice that your code is starting to have repeated statements and declarations more than a few times, it is probably time to address them.

This guide will use **repeated parameters** as the context of examples, because it's the most common place to have code duplication. However, these deduplication logics can be applied to other scenarios.

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "workery",
"version": "1.1.1",
"version": "1.1.2",
"description": "Modern web framework for building APIs on Cloudflare Workers.",
"type": "module",
"main": "./dist/index.cjs",
Expand Down
5 changes: 5 additions & 0 deletions tests/routing.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,13 @@ describe("function generateRouteSummary", () => {
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("GET", "/items/{itemId}/subitems")).toBe("Read Items Subitems")
expect(generateRouteSummary("GET", ";droigh/675/等级")).toBeTruthy()
expect(generateRouteSummary("PATCH", "//route/")).toBe("Modify Route")
expect(generateRouteSummary("DELETE", "")).toBe("Delete")
expect(generateRouteSummary("TRACE", "")).toBe("Trace")
expect(generateRouteSummary("OPTIONS", "")).toBe("Check")
expect(generateRouteSummary("HEAD", "/items")).toBe("Head Items")
})
})

Expand Down

0 comments on commit 8daec5f

Please sign in to comment.