Skip to content

Commit b2e00fd

Browse files
committed
[IO-363] fix non descriptive names
1 parent 623a051 commit b2e00fd

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/language/typescript/3.0/serializers/response-object.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,9 @@ import { Option } from 'fp-ts/lib/Option';
1414
import { ReferenceObject, ReferenceObjectCodec } from '../../../../schema/3.0/reference-object';
1515
import { getKeyMatchValue, getKeyMatchValues, getResponseTypeFromMediaType, XHRResponseType } from '../../common/utils';
1616
import { SchemaObject } from '../../../../schema/3.0/schema-object';
17-
import { MediaTypeObject } from '../../../../schema/3.0/media-type-object';
1817
import { sequenceEither } from '@devexperts/utils/dist/adt/either.utils';
1918

2019
const requestMediaRegexp = /^(video|audio|image|application|text)/;
21-
export const getResponseMedia = (content: Record<string, MediaTypeObject>) =>
22-
getKeyMatchValue(content, requestMediaRegexp);
23-
24-
export const getResponseMedia2 = (content: Record<string, MediaTypeObject>) =>
25-
getKeyMatchValues(content, requestMediaRegexp);
2620

2721
export type SerializedResponse = { mediaType: string; schema: SerializedType };
2822

@@ -32,7 +26,7 @@ export const serializeResponseObject = (
3226
): Option<Either<Error, SerializedType>> =>
3327
pipe(
3428
responseObject.content,
35-
option.chain(content => getResponseMedia(content)),
29+
option.chain(content => getKeyMatchValue(content, requestMediaRegexp)),
3630
option.chain(({ key: mediaType, value: { schema } }) =>
3731
pipe(
3832
schema,
@@ -51,7 +45,7 @@ export const serializeResponseObjectWithMediaType = (
5145
): Option<Either<Error, SerializedResponse[]>> =>
5246
pipe(
5347
responseObject.content,
54-
option.chain(content => getResponseMedia2(content)),
48+
option.chain(content => getKeyMatchValues(content, requestMediaRegexp)),
5549
option.chain(arr =>
5650
pipe(
5751
arr,

0 commit comments

Comments
 (0)