Skip to content

Commit eb5432e

Browse files
authored
Merge pull request #528 from BitGo/cd17dependabot/npm_and_yarn/prettier-3.0.3
chore(deps-dev): bump prettier from 2.8.8 to 3.0.3
2 parents b7259d8 + 64fb4c9 commit eb5432e

File tree

4 files changed

+38
-29
lines changed

4 files changed

+38
-29
lines changed

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"multi-semantic-release": "3.0.2",
3838
"patch-package": "8.0.0",
3939
"pre-commit": "1.2.2",
40-
"prettier": "2.8.8",
40+
"prettier": "3.0.3",
4141
"turbo": "1.10.13",
4242
"typescript": "4.6.4"
4343
},

packages/express-wrapper/test/server.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ const GetHelloWorld = async (params: { id: string }) =>
100100
({
101101
type: 'ok',
102102
payload: params,
103-
} as const);
103+
}) as const;
104104

105105
test('should offer a delightful developer experience', async () => {
106106
const app = createServer(ApiSpec, (app: express.Application) => {

packages/openapi-generator/src/openapi.ts

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,17 @@ function schemaToOpenAPI(
2525
case 'object':
2626
return {
2727
type: 'object',
28-
properties: Object.entries(schema.properties).reduce((acc, [name, prop]) => {
29-
const innerSchema = schemaToOpenAPI(prop);
30-
if (innerSchema === undefined) {
31-
return acc;
32-
}
28+
properties: Object.entries(schema.properties).reduce(
29+
(acc, [name, prop]) => {
30+
const innerSchema = schemaToOpenAPI(prop);
31+
if (innerSchema === undefined) {
32+
return acc;
33+
}
3334

34-
return { ...acc, [name]: innerSchema };
35-
}, {} as Record<string, OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject>),
35+
return { ...acc, [name]: innerSchema };
36+
},
37+
{} as Record<string, OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject>,
38+
),
3639
required: schema.required,
3740
};
3841
case 'intersection':
@@ -128,21 +131,27 @@ export function convertRoutesToOpenAPI(
128131
routes: Route[],
129132
schemas: Components,
130133
): OpenAPIV3_1.Document {
131-
const paths = routes.reduce((acc, route) => {
132-
const [path, method, pathItem] = routeToOpenAPI(route);
133-
let pathObject = acc[path] ?? {};
134-
pathObject[method] = pathItem;
135-
return { ...acc, [path]: pathObject };
136-
}, {} as Record<string, Record<string, OpenAPIV3_1.PathItemObject>>);
134+
const paths = routes.reduce(
135+
(acc, route) => {
136+
const [path, method, pathItem] = routeToOpenAPI(route);
137+
let pathObject = acc[path] ?? {};
138+
pathObject[method] = pathItem;
139+
return { ...acc, [path]: pathObject };
140+
},
141+
{} as Record<string, Record<string, OpenAPIV3_1.PathItemObject>>,
142+
);
137143

138-
const openapiSchemas = Object.entries(schemas).reduce((acc, [name, schema]) => {
139-
const openapiSchema = schemaToOpenAPI(schema);
140-
if (openapiSchema === undefined) {
141-
return acc;
142-
} else {
143-
return { ...acc, [name]: openapiSchema };
144-
}
145-
}, {} as Record<string, OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject>);
144+
const openapiSchemas = Object.entries(schemas).reduce(
145+
(acc, [name, schema]) => {
146+
const openapiSchema = schemaToOpenAPI(schema);
147+
if (openapiSchema === undefined) {
148+
return acc;
149+
} else {
150+
return { ...acc, [name]: openapiSchema };
151+
}
152+
},
153+
{} as Record<string, OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject>,
154+
);
146155

147156
return {
148157
openapi: '3.1.0',

0 commit comments

Comments
 (0)