Skip to content

Commit 146a29a

Browse files
committed
fix: types
1 parent 30328be commit 146a29a

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

adonis-typings/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
* file that was distributed with this source code.
88
*/
99

10+
/// <reference path="./container.ts" />
1011
/// <reference path="./context.ts" />
1112
/// <reference path="./http-server.ts" />
1213
/// <reference path="./middleware.ts" />
13-
/// <reference path="./route.ts" />
1414
/// <reference path="./request.ts" />
1515
/// <reference path="./response.ts" />
16+
/// <reference path="./route.ts" />

adonis-typings/request.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ declare module '@ioc:Adonis/Core/Request' {
7474
*/
7575
updateQs(data: any): void
7676

77+
/**
78+
* Returns route params
79+
*/
80+
params(): { [key: string]: any }
81+
7782
/**
7883
* Returns reference to the query string object
7984
*/
@@ -118,6 +123,19 @@ declare module '@ioc:Adonis/Core/Request' {
118123
*/
119124
input(key: string, defaultValue?: any): any
120125

126+
/**
127+
* Returns value for a given key from route params
128+
*
129+
* @example
130+
* ```js
131+
* request.param('id')
132+
*
133+
* // with default value
134+
* request.param('id', 1)
135+
* ```
136+
*/
137+
param(key: string, defaultValue?: any): any
138+
121139
/**
122140
* Get everything from the request body except the given keys.
123141
*

npm-audit.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ <h5 class="card-title">
5555
<div class="card">
5656
<div class="card-body">
5757
<h5 class="card-title">
58-
September 27th 2020, 1:46:46 pm
58+
September 27th 2020, 4:36:19 pm
5959
</h5>
6060
<p class="card-text">Last updated</p>
6161
</div>

0 commit comments

Comments
 (0)