Skip to content

Commit e0e3564

Browse files
committedSep 27, 2019
Remove Request.user declarations (lukeautry#486)
I actually moved them to the test file that uses this property to keep the typescript compiler happy. I added the tests & docs folder to the .npmignore to avoid conflict and because they shouldn't be published (as far as I know). No template modification was needed because `request` has an any type there.
1 parent a03cd02 commit e0e3564

File tree

6 files changed

+20
-22
lines changed

6 files changed

+20
-22
lines changed
 

‎.npmignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
!dist/**
22
!distForNoAdditional/**
3+
tests/
4+
docs/

‎src/express.d.ts

-6
This file was deleted.

‎src/hapi.d.ts

-6
This file was deleted.

‎src/index.ts

-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
/// <reference path="express.d.ts" />
2-
/// <reference path="hapi.d.ts" />
3-
/// <reference path="koa.d.ts" />
4-
51
export * from './decorators/example';
62
export * from './decorators/parameter';
73
export * from './decorators/methods';

‎src/koa.d.ts

-6
This file was deleted.

‎tests/fixtures/controllers/securityController.ts

+18
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,24 @@ import * as koa from 'koa';
44
import { Get, Request, Response, Route, Security } from '../../../src';
55
import { ErrorResponseModel, UserResponseModel } from '../../fixtures/testModel';
66

7+
declare module 'express' {
8+
interface Request {
9+
user?: any;
10+
}
11+
}
12+
13+
declare module '@hapi/hapi' {
14+
interface Request {
15+
user?: any;
16+
}
17+
}
18+
19+
declare module 'koa' {
20+
interface Request {
21+
user?: any;
22+
}
23+
}
24+
725
@Route('SecurityTest')
826
export class SecurityTestController {
927
@Response<ErrorResponseModel>('default', 'Unexpected error')

0 commit comments

Comments
 (0)
Please sign in to comment.