Skip to content

Commit f886d1b

Browse files
committed
fix: Upgrade dev-dependencies, openapi-ts, and promise-breaker.
1 parent a51da89 commit f886d1b

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"@types/glob": "^7.1.1",
5252
"@types/json-schema": "^7.0.3",
5353
"@types/lodash": "^4.14.132",
54-
"@types/mocha": "^9.0.0",
54+
"@types/mocha": "^10.0.0",
5555
"@types/node": "^18.7.23",
5656
"@types/pump": "^1.0.1",
5757
"@types/qs": "^6.5.1",
@@ -62,9 +62,9 @@
6262
"chai-as-promised": "^7.1.1",
6363
"coveralls": "^3.0.2",
6464
"eslint": "^8.3.0",
65-
"husky": "^7.0.4",
66-
"lint-staged": "^12.1.2",
67-
"mocha": "^9.1.3",
65+
"husky": "^8.0.1",
66+
"lint-staged": "^13.0.3",
67+
"mocha": "^10.1.0",
6868
"nyc": "^15.0.0",
6969
"prettier": "^2.0.5",
7070
"pretty-quick": "^3.0.0",
@@ -85,8 +85,8 @@
8585
"json-ptr": "^3.0.1",
8686
"json-schema-traverse": "^1.0.0",
8787
"lodash": "^4.17.11",
88-
"openapi3-ts": "^2.0.1",
89-
"promise-breaker": "^5.0.0",
88+
"openapi3-ts": "^3.1.1",
89+
"promise-breaker": "^6.0.0",
9090
"pump": "^3.0.0",
9191
"qs": "^6.6.0",
9292
"raw-body": "^2.3.3",

src/oas3/Path.ts

+8-7
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Parameter from './Parameter';
66
import { EXEGESIS_CONTROLLER } from './extensions';
77

88
// CONNECT not included, as it is not valid for OpenAPI 3.0.1.
9-
const HTTP_METHODS = ['GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'OPTIONS', 'TRACE', 'PATCH'];
9+
const HTTP_METHODS = ['get', 'head', 'post', 'put', 'delete', 'options', 'trace', 'patch'] as const;
1010

1111
interface OperationsMap {
1212
[key: string]: Operation;
@@ -33,19 +33,20 @@ export default class Path {
3333
);
3434

3535
exegesisController = oaPath[EXEGESIS_CONTROLLER] || exegesisController;
36-
this._operations = HTTP_METHODS.map((method) => method.toLowerCase())
37-
.filter((method) => oaPath[method])
38-
.reduce((result: OperationsMap, method: string) => {
36+
this._operations = HTTP_METHODS.reduce((result: OperationsMap, method) => {
37+
const operation = oaPath[method];
38+
if (operation) {
3939
result[method] = new Operation(
4040
context.childContext(method),
41-
oaPath[method],
41+
operation,
4242
oaPath,
4343
method,
4444
exegesisController,
4545
parameters
4646
);
47-
return result;
48-
}, Object.create(null));
47+
}
48+
return result;
49+
}, Object.create(null));
4950
}
5051

5152
getOperation(method: string): Operation | undefined {

0 commit comments

Comments
 (0)