Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3bd8f0f

Browse filesBrowse files
committed
fix: remove Type suffix from serialised routes
1 parent 3567b41 commit 3bd8f0f
Copy full SHA for 3bd8f0f

2 files changed

+5-5Lines changed: 5 additions & 5 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/serialize.ts‎

Copy file name to clipboardExpand all lines: src/serialize.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ function stringifyRouteTree(tree: RouteTree, indent = 2): string {
7272
if (!value) {
7373
continue
7474
}
75-
const key = keys[_key] || JSON.stringify(_key)
75+
const key = keys[_key] || JSON.stringify((_key as string).replace(/Type$/, ''))
7676
if (typeof value === 'string') {
7777
properties += `${' '.repeat(indent)}${key}: ${value}\n`
7878
}
Collapse file

‎test/serialize.test.ts‎

Copy file name to clipboardExpand all lines: test/serialize.test.ts
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ describe('serialize', () => {
3131
interface InternalRoutes {
3232
"/": {
3333
"GET": {
34-
"responseType": { type: 'headers', method: 'POST' }
35-
"headersType": { authorization: 'string' }
34+
"response": { type: 'headers', method: 'POST' }
35+
"headers": { authorization: 'string' }
3636
}
3737
}
3838
"/bob": {
3939
[DynamicParam]: {
4040
"POST": {
41-
"responseType": { type: 'headers', method: 'POST' }
42-
"headersType": { authorization: 'string' }
41+
"response": { type: 'headers', method: 'POST' }
42+
"headers": { authorization: 'string' }
4343
}
4444
}
4545
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.