Skip to content

Commit

Permalink
chore(deps): update dependency prettier to v3.1.0 (#2534)
Browse files Browse the repository at this point in the history
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nicholas Lim <[email protected]>
  • Loading branch information
renovate[bot] and niclim authored Dec 6, 2023
1 parent 83fd861 commit 1312510
Show file tree
Hide file tree
Showing 42 changed files with 329 additions and 329 deletions.
4 changes: 2 additions & 2 deletions projects/fastify-capture/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ function formatSetCookiesHeader(
return typeof setCookiesHeader === 'string'
? setCookiesHeader
: Array.isArray(setCookiesHeader)
? setCookiesHeader
: String(setCookiesHeader ?? '');
? setCookiesHeader
: String(setCookiesHeader ?? '');
}

function buildResponseCookies(setCookies: string | string[]) {
Expand Down
8 changes: 4 additions & 4 deletions projects/openapi-io/src/denormalizers/denormalizeProperty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ export function denormalizeProperty(
const polymorphicKey = schema.allOf
? 'allOf'
: schema.anyOf
? 'anyOf'
: schema.oneOf
? 'oneOf'
: null;
? 'anyOf'
: schema.oneOf
? 'oneOf'
: null;
const polymorphicValue = schema.allOf || schema.anyOf || schema.oneOf;
if (polymorphicKey && polymorphicValue) {
if (
Expand Down
12 changes: 6 additions & 6 deletions projects/openapi-io/src/validation/log-json-pointer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@ function renderCodeFrame(
!shouldHighlight
? line
: optionsOrDefault.highlightColor === 'red'
? chalk.bold.red(lineWithObservation)
: optionsOrDefault.highlightColor === 'green'
? chalk.bold.green(lineWithObservation)
: optionsOrDefault.highlightColor === 'yellow'
? chalk.bold.yellow(lineWithObservation)
: line
? chalk.bold.red(lineWithObservation)
: optionsOrDefault.highlightColor === 'green'
? chalk.bold.green(lineWithObservation)
: optionsOrDefault.highlightColor === 'yellow'
? chalk.bold.yellow(lineWithObservation)
: line
}`;
});

Expand Down
4 changes: 2 additions & 2 deletions projects/openapi-io/src/write/yaml-roundtrip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ export function applyOperationsToYamlString(
!isNaN(Number(lastIndex))
? lastIndex
: lastPathItem === '-'
? arrayCollection.items.length
: 0,
? arrayCollection.items.length
: 0,
node
);

Expand Down
8 changes: 4 additions & 4 deletions projects/openapi-utilities/src/diff/diff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ export function typeofDiff(
return diff.after !== undefined && diff.before !== undefined
? 'changed'
: diff.after !== undefined
? 'added'
: 'removed';
? 'added'
: 'removed';
}

// Diffs two objects, generating the leaf nodes that have changes
Expand Down Expand Up @@ -105,8 +105,8 @@ export function diff(
isPathParameterArray(afterPathIdentity)
? getParameterIdentity
: allValues.every((v) => typeof v !== 'object')
? (v: any) => String(v)
: (_, i: number) => String(i);
? (v: any) => String(v)
: (_, i: number) => String(i);

const beforeValuesById: Map<string, [JSONValue, number]> = new Map(
before.value.map((v, i) => [arrayIdFn(v, i), [v, i]])
Expand Down
12 changes: 6 additions & 6 deletions projects/openapi-utilities/src/openapi3/group-diff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@ function normalizeRequiredDiff(
fact.type === 'body' && trailParts[1] === 'required'
? jsonPointerHelpers.append(fact.location.jsonPath, 'schema')
: fact.type === 'field' && trailParts[0] === 'required'
? fact.location.jsonPath
: null;
? fact.location.jsonPath
: null;
const location = getLocation(fact);

if (!maybeBaseRequiredPath) {
Expand Down Expand Up @@ -432,10 +432,10 @@ export function groupDiffsByEndpoint(
fact.type === 'request-header'
? 'headerParameters'
: fact.type === 'request-query'
? 'queryParameters'
: fact.type === 'request-cookie'
? 'cookieParameters'
: 'pathParameters';
? 'queryParameters'
: fact.type === 'request-cookie'
? 'cookieParameters'
: 'pathParameters';
const { pathPattern, method } = getLocation(fact);
const endpointId = getEndpointId({ path: pathPattern, method });
const endpoint = grouped.getOrSetEndpoint(endpointId);
Expand Down
196 changes: 98 additions & 98 deletions projects/openapi-utilities/src/openapi3/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,105 +31,105 @@ export type OpenApiV3TraverserFact<T extends V3FactType> = T extends T
export type FactLocation<T extends V3FactType> = T extends 'specification'
? {}
: T extends 'path'
? { pathPattern: string }
: T extends
| 'operation'
| 'request-header'
| 'request-query'
| 'request-cookie'
| 'request-path'
| 'requestBody'
? { pathPattern: string; method: string }
: T extends 'body'
?
| {
location: 'response';
pathPattern: string;
method: string;
statusCode: string;
contentType: string;
}
| {
location: 'request';
pathPattern: string;
method: string;
contentType: string;
}
: T extends 'body-example' | 'body-examples'
?
| {
location: 'response';
pathPattern: string;
method: string;
statusCode: string;
contentType: string;
trail: string[];
}
| {
location: 'request';
pathPattern: string;
method: string;
contentType: string;
trail: string[];
}
: T extends 'field'
?
| {
location: 'response';
pathPattern: string;
method: string;
statusCode: string;
contentType: string;
trail: string[];
}
| {
location: 'request';
pathPattern: string;
method: string;
contentType: string;
trail: string[];
}
: T extends 'response'
? { pathPattern: string; method: string; statusCode: string }
: T extends 'response-header'
? {
pathPattern: string;
method: string;
statusCode: string;
headerName: string;
}
: T extends 'component-schema-example'
? {}
: never;
? { pathPattern: string }
: T extends
| 'operation'
| 'request-header'
| 'request-query'
| 'request-cookie'
| 'request-path'
| 'requestBody'
? { pathPattern: string; method: string }
: T extends 'body'
?
| {
location: 'response';
pathPattern: string;
method: string;
statusCode: string;
contentType: string;
}
| {
location: 'request';
pathPattern: string;
method: string;
contentType: string;
}
: T extends 'body-example' | 'body-examples'
?
| {
location: 'response';
pathPattern: string;
method: string;
statusCode: string;
contentType: string;
trail: string[];
}
| {
location: 'request';
pathPattern: string;
method: string;
contentType: string;
trail: string[];
}
: T extends 'field'
?
| {
location: 'response';
pathPattern: string;
method: string;
statusCode: string;
contentType: string;
trail: string[];
}
| {
location: 'request';
pathPattern: string;
method: string;
contentType: string;
trail: string[];
}
: T extends 'response'
? { pathPattern: string; method: string; statusCode: string }
: T extends 'response-header'
? {
pathPattern: string;
method: string;
statusCode: string;
headerName: string;
}
: T extends 'component-schema-example'
? {}
: never;

export type FactRawItem<T extends V3FactType> = T extends 'specification'
? OpenAPIV3.Document
: T extends 'path'
? OpenAPIV3.PathItemObject
: T extends 'operation'
? OpenAPIV3.OperationObject
: T extends 'request-header'
? OpenAPIV3.ParameterObject
: T extends 'request-query'
? OpenAPIV3.ParameterObject
: T extends 'request-cookie'
? OpenAPIV3.ParameterObject
: T extends 'request-path'
? OpenAPIV3.ParameterObject
: T extends 'body'
? OpenAPIV3.MediaTypeObject
: T extends 'requestBody'
? OpenAPIV3.RequestBodyObject
: T extends 'field'
? OpenAPIV3.SchemaObject
: T extends 'response'
? OpenAPIV3.ResponseObject
: T extends 'response-header'
? OpenAPIV3.HeaderObject
: T extends 'body-example'
? NonNullable<OpenAPIV3.MediaTypeObject['example']>
: T extends 'body-examples'
? OpenAPIV3.ExampleObject
: T extends 'component-schema-example'
? OpenAPIV3.ExampleObject
: never;
? OpenAPIV3.PathItemObject
: T extends 'operation'
? OpenAPIV3.OperationObject
: T extends 'request-header'
? OpenAPIV3.ParameterObject
: T extends 'request-query'
? OpenAPIV3.ParameterObject
: T extends 'request-cookie'
? OpenAPIV3.ParameterObject
: T extends 'request-path'
? OpenAPIV3.ParameterObject
: T extends 'body'
? OpenAPIV3.MediaTypeObject
: T extends 'requestBody'
? OpenAPIV3.RequestBodyObject
: T extends 'field'
? OpenAPIV3.SchemaObject
: T extends 'response'
? OpenAPIV3.ResponseObject
: T extends 'response-header'
? OpenAPIV3.HeaderObject
: T extends 'body-example'
? NonNullable<OpenAPIV3.MediaTypeObject['example']>
: T extends 'body-examples'
? OpenAPIV3.ExampleObject
: T extends 'component-schema-example'
? OpenAPIV3.ExampleObject
: never;
8 changes: 4 additions & 4 deletions projects/openapi-utilities/src/results.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ export function textToSev(sev: SeverityText): Severity {
return sev === 'info'
? Severity.Info
: sev === 'warn'
? Severity.Warn
: Severity.Error;
? Severity.Warn
: Severity.Error;
}

export function sevToText(sev: Severity): SeverityText {
return sev === Severity.Info
? 'info'
: sev === Severity.Warn
? 'warn'
: 'error';
? 'warn'
: 'error';
}

export enum Severity {
Expand Down
16 changes: 8 additions & 8 deletions projects/openapi-utilities/src/utilities/changelog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ const getChangeType = (diff: ObjectDiff) => {
return diff.after && diff.before
? 'changed'
: diff.after
? 'added'
: 'removed';
? 'added'
: 'removed';
};

const isPathChange = (segments: string[]) => segments[0] === 'paths';
Expand Down Expand Up @@ -223,12 +223,12 @@ export function getEndpointsChanges(
return isRequestChange(segments)
? getRequestBodyChange(segments, changeType, spec)
: isResponseChange(segments)
? getResponseChange(segments, changeType, spec)
: isMethodParameterChange(segments)
? getParameterChange(segments, changeType, spec)
: isMethodExactChange(segments)
? `${changeType}`
: ``;
? getResponseChange(segments, changeType, spec)
: isMethodParameterChange(segments)
? getParameterChange(segments, changeType, spec)
: isMethodExactChange(segments)
? `${changeType}`
: ``;
};

for (const diff of diffs) {
Expand Down
20 changes: 10 additions & 10 deletions projects/optic/src/client/JsonHttpClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ export class JsonHttpClient {
response.status === 400
? new BadRequestError(message, this.source)
: response.status === 401
? new UnauthorizedError(message, this.source)
: response.status === 403
? new ForbiddenError(message, this.source)
: response.status === 404
? new NotFoundError(message, this.source)
: response.status === 500
? new InternalError(message, this.source)
: response.status === 503
? new ServiceUnavailableError(message, this.source)
: new Error(message);
? new UnauthorizedError(message, this.source)
: response.status === 403
? new ForbiddenError(message, this.source)
: response.status === 404
? new NotFoundError(message, this.source)
: response.status === 500
? new InternalError(message, this.source)
: response.status === 503
? new ServiceUnavailableError(message, this.source)
: new Error(message);

throw error;
}
Expand Down
Loading

0 comments on commit 1312510

Please sign in to comment.