Skip to content

Commit e88deab

Browse files
committed
ci: Format code
1 parent 392c9a0 commit e88deab

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

src/lib/blueprint.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,9 @@ const getNamespacePath = (path: string, paths: OpenapiPaths): string | null => {
570570

571571
// An endpoint is a route that ends without further paths. i.e., ends in
572572
// a letter (not slash).
573-
const endpoints = pathKeys.filter((key) => new RegExp(`^/${[...namespace, part].join('/')}/\\w+$`).test(key))
573+
const endpoints = pathKeys.filter((key) =>
574+
new RegExp(`^/${[...namespace, part].join('/')}/\\w+$`).test(key),
575+
)
574576

575577
if (endpoints.length === 0) {
576578
namespace.push(part)
@@ -855,7 +857,7 @@ const createRequestBody = (
855857
return []
856858
}
857859

858-
const {requestBody} = operation
860+
const { requestBody } = operation
859861
const jsonSchema = requestBody.content?.['application/json']?.schema
860862
if (jsonSchema == null) return []
861863

@@ -875,7 +877,8 @@ const createParameters = (
875877
properties: Record<string, OpenapiSchema>,
876878
path: string,
877879
requiredParameters: string[] = [],
878-
): Parameter[] => Object.entries(properties)
880+
): Parameter[] =>
881+
Object.entries(properties)
879882
.map(([name, property]) => {
880883
// Don't flatten discriminated arrays as they are handled separately in createParameter
881884
if (
@@ -1319,7 +1322,7 @@ const createResponse = (
13191322
typeof schema.properties === 'object' &&
13201323
schema.properties !== null
13211324
) {
1322-
const {properties} = schema
1325+
const { properties } = schema
13231326

13241327
if (!(responseKey in properties)) {
13251328
throw new Error(
@@ -1402,7 +1405,8 @@ export const createProperties = (
14021405
properties: Record<string, OpenapiSchema>,
14031406
parentPaths: string[],
14041407
propertyGroups: PropertyGroup[],
1405-
): Property[] => Object.entries(properties)
1408+
): Property[] =>
1409+
Object.entries(properties)
14061410
.map(([name, property]) => {
14071411
// Don't flatten discriminated arrays as they are handled separately in createProperty
14081412
if (

src/lib/samples/go.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,15 @@ const formatGoRequestArgValue = (
113113
context: GoContext,
114114
): string => {
115115
if (value == null) return 'nil'
116-
if (typeof value === 'string')
116+
if (typeof value === 'string') {
117117
return `${defaultGoPackageName}.String("${value}")`
118-
if (typeof value === 'boolean')
118+
}
119+
if (typeof value === 'boolean') {
119120
return `${defaultGoPackageName}.Bool(${value})`
120-
if (typeof value === 'number')
121+
}
122+
if (typeof value === 'number') {
121123
return `${defaultGoPackageName}.Float64(${value})`
124+
}
122125

123126
if (Array.isArray(value)) {
124127
return formatGoRequestArrayValue(key, value, context)

0 commit comments

Comments
 (0)