Skip to content

Commit b2321cf

Browse files
committed
fix: make some properties in KeqContext readonly to prevent modifications
1 parent 87f5a78 commit b2321cf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/types/keq-context.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export interface KeqContext {
2121
*
2222
* next: to prevent someone invoke `next()` multiple times or forgetting await
2323
*/
24-
metadata: {
24+
readonly metadata: {
2525
// Is middleware running completed
2626
finished: boolean
2727
// How many times the next() is called
@@ -40,14 +40,14 @@ export interface KeqContext {
4040
*/
4141
readonly identifier: string
4242

43-
emitter: Emitter<Omit<KeqEvents, never>>
43+
readonly emitter: Emitter<Omit<KeqEvents, never>>
4444

4545
options: KeqContextOptions
4646

4747
/**
4848
* keq request context
4949
*/
50-
request: KeqContextRequest
50+
readonly request: KeqContextRequest
5151

5252
/**
5353
* original response
@@ -68,7 +68,7 @@ export interface KeqContext {
6868
/**
6969
* share data between requests
7070
*/
71-
global: KeqGlobal
71+
readonly global: KeqGlobal
7272

7373
// ===================================================
7474
// The following properties are extends by middleware

0 commit comments

Comments
 (0)