Skip to content

Commit 49dc96e

Browse files
authored
Merge pull request #29 from tibber/upgrade-gts-4
Upgrade GTS
2 parents b29d6e3 + 093c708 commit 49dc96e

16 files changed

+218
-392
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## [3.3.1-upgrade-gts-4.1](https://github.com/tibber/tibber-express-utils/compare/v3.3.0...v3.3.1-upgrade-gts-4.1) (2022-08-17)
2+
3+
4+
### Bug Fixes
5+
6+
* upgrade gts to avoid got vulnerability ([b29d6e3](https://github.com/tibber/tibber-express-utils/commit/b29d6e3a7152c086a257512c9669b32c6819af42))
7+
18
# [3.3.0](https://github.com/tibber/tibber-express-utils/compare/v3.2.0...v3.3.0) (2022-08-15)
29

310

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tibber-express-utils",
3-
"version": "3.3.0",
3+
"version": "3.3.1-upgrade-gts-4.1",
44
"description": "",
55
"main": "./dist/src/index.js",
66
"scripts": {
@@ -36,7 +36,6 @@
3636
"conventional-commits": "^1.6.0",
3737
"cz-conventional-changelog": "^3.3.0",
3838
"dotenv-cli": "^6.0.0",
39-
"eslint": "7.14.0",
4039
"eslint-plugin-jest": "^26.8.2",
4140
"eslint-plugin-node": "^11.1.0",
4241
"express": "^4.18.1",

src/handlers/jsonDelete.ts

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,22 @@ import {
88
Logger,
99
} from '../types';
1010

11-
export const jsonDelete = <TContext>(
12-
jsonRouter: JsonRouter<TContext>,
13-
_contextSelector: ContextSelector<TContext>,
14-
logger?: Logger
15-
) => <TPayload>(
16-
path: PathParams,
17-
handler: JsonRequestHandler<TContext, TPayload>
18-
) =>
19-
jsonRouter.delete(
20-
path,
21-
jsonMiddleware(
22-
NoContentIfNoCodeOtherwiseOk,
23-
_contextSelector,
24-
handler,
25-
logger
26-
)
27-
);
11+
export const jsonDelete =
12+
<TContext>(
13+
jsonRouter: JsonRouter<TContext>,
14+
_contextSelector: ContextSelector<TContext>,
15+
logger?: Logger
16+
) =>
17+
<TPayload>(
18+
path: PathParams,
19+
handler: JsonRequestHandler<TContext, TPayload>
20+
) =>
21+
jsonRouter.delete(
22+
path,
23+
jsonMiddleware(
24+
NoContentIfNoCodeOtherwiseOk,
25+
_contextSelector,
26+
handler,
27+
logger
28+
)
29+
);

src/handlers/jsonGet.ts

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,22 @@ import {
88
Logger,
99
} from '../types';
1010

11-
export const jsonGet = <TContext>(
12-
jsonRouter: JsonRouter<TContext>,
13-
_contextSelector: ContextSelector<TContext>,
14-
logger?: Logger
15-
) => <TPayload>(
16-
path: PathParams,
17-
handler: JsonRequestHandler<TContext, TPayload>
18-
) =>
19-
jsonRouter.get(
20-
path,
21-
jsonMiddleware(
22-
NotFoundIfNoCodeOtherwiseOk,
23-
_contextSelector,
24-
handler,
25-
logger
26-
)
27-
);
11+
export const jsonGet =
12+
<TContext>(
13+
jsonRouter: JsonRouter<TContext>,
14+
_contextSelector: ContextSelector<TContext>,
15+
logger?: Logger
16+
) =>
17+
<TPayload>(
18+
path: PathParams,
19+
handler: JsonRequestHandler<TContext, TPayload>
20+
) =>
21+
jsonRouter.get(
22+
path,
23+
jsonMiddleware(
24+
NotFoundIfNoCodeOtherwiseOk,
25+
_contextSelector,
26+
handler,
27+
logger
28+
)
29+
);

src/handlers/jsonPatch.ts

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,22 @@ import {
88
Logger,
99
} from '../types';
1010

11-
export const jsonPatch = <TContext>(
12-
jsonRouter: JsonRouter<TContext>,
13-
_contextSelector: ContextSelector<TContext>,
14-
logger?: Logger
15-
) => <TPayload>(
16-
path: PathParams,
17-
handler: JsonRequestHandler<TContext, TPayload>
18-
) =>
19-
jsonRouter.patch(
20-
path,
21-
jsonMiddleware(
22-
NoContentIfNoCodeOtherwiseOk,
23-
_contextSelector,
24-
handler,
25-
logger
26-
)
27-
);
11+
export const jsonPatch =
12+
<TContext>(
13+
jsonRouter: JsonRouter<TContext>,
14+
_contextSelector: ContextSelector<TContext>,
15+
logger?: Logger
16+
) =>
17+
<TPayload>(
18+
path: PathParams,
19+
handler: JsonRequestHandler<TContext, TPayload>
20+
) =>
21+
jsonRouter.patch(
22+
path,
23+
jsonMiddleware(
24+
NoContentIfNoCodeOtherwiseOk,
25+
_contextSelector,
26+
handler,
27+
logger
28+
)
29+
);

src/handlers/jsonPost.ts

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,22 @@ import {
88
Logger,
99
} from '../types';
1010

11-
export const jsonPost = <TContext>(
12-
jsonRouter: JsonRouter<TContext>,
13-
_contextSelector: ContextSelector<TContext>,
14-
logger?: Logger
15-
) => <TPayload>(
16-
path: PathParams,
17-
handler: JsonRequestHandler<TContext, TPayload>
18-
) =>
19-
jsonRouter.post(
20-
path,
21-
jsonMiddleware(
22-
NoContentIfNoCodeOtherwiseOk,
23-
_contextSelector,
24-
handler,
25-
logger
26-
)
27-
);
11+
export const jsonPost =
12+
<TContext>(
13+
jsonRouter: JsonRouter<TContext>,
14+
_contextSelector: ContextSelector<TContext>,
15+
logger?: Logger
16+
) =>
17+
<TPayload>(
18+
path: PathParams,
19+
handler: JsonRequestHandler<TContext, TPayload>
20+
) =>
21+
jsonRouter.post(
22+
path,
23+
jsonMiddleware(
24+
NoContentIfNoCodeOtherwiseOk,
25+
_contextSelector,
26+
handler,
27+
logger
28+
)
29+
);

src/handlers/jsonPut.ts

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,22 @@ import {
88
Logger,
99
} from '../types';
1010

11-
export const jsonPut = <TContext>(
12-
jsonRouter: JsonRouter<TContext>,
13-
_contextSelector: ContextSelector<TContext>,
14-
logger?: Logger
15-
) => <TPayload>(
16-
path: PathParams,
17-
handler: JsonRequestHandler<TContext, TPayload>
18-
) =>
19-
jsonRouter.put(
20-
path,
21-
jsonMiddleware(
22-
NoContentIfNoCodeOtherwiseOk,
23-
_contextSelector,
24-
handler,
25-
logger
26-
)
27-
);
11+
export const jsonPut =
12+
<TContext>(
13+
jsonRouter: JsonRouter<TContext>,
14+
_contextSelector: ContextSelector<TContext>,
15+
logger?: Logger
16+
) =>
17+
<TPayload>(
18+
path: PathParams,
19+
handler: JsonRequestHandler<TContext, TPayload>
20+
) =>
21+
jsonRouter.put(
22+
path,
23+
jsonMiddleware(
24+
NoContentIfNoCodeOtherwiseOk,
25+
_contextSelector,
26+
handler,
27+
logger
28+
)
29+
);

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export * from './HttpResult';
2-
export * from './jsonRouting';
3-
export * from './jsonMiddleware';
42
export * as Errors from './errors';
3+
export * from './jsonMiddleware';
4+
export * from './jsonRouting';
55
export * from './types';

src/utils/ContextOf.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@ import {ContextSelector} from '../types';
44
* Given a concrete ContextSelector function, infers the type of the context
55
* that it selects.
66
*/
7-
export type ContextOf<
8-
TContextSelector extends ContextSelector<unknown>
9-
> = TContextSelector extends ContextSelector<infer U> ? U : never;
7+
export type ContextOf<TContextSelector extends ContextSelector<unknown>> =
8+
TContextSelector extends ContextSelector<infer U> ? U : never;

src/utils/hasOwnProperty.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ export const hasOwnProperty = <
1111
>(
1212
target: TTarget,
1313
propertyKey: TPropertyKey
14-
): target is TTarget & Record<TPropertyKey, unknown> => {
14+
): target is Record<TPropertyKey, unknown> & TTarget => {
1515
return Object.prototype.hasOwnProperty.call(target, propertyKey);
1616
};

0 commit comments

Comments
 (0)