Skip to content
This repository was archived by the owner on Nov 28, 2022. It is now read-only.

Commit f0fc306

Browse files
author
Dom Harrington
committed
Prettier
1 parent 67b9a03 commit f0fc306

File tree

3 files changed

+21
-18
lines changed

3 files changed

+21
-18
lines changed

packages/api-explorer-ui/src/CodeSampleResponse.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ class CodeSampleResponse extends React.Component {
148148
)}
149149
</div>
150150

151-
{ this.state.selectedTab === 'metadata' && <ResponseMetadata result={result} /> }
151+
{this.state.selectedTab === 'metadata' && <ResponseMetadata result={result} />}
152152
</span>
153153
)}
154154
</div>

packages/api-explorer-ui/src/ResponseMetadata.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ const PropTypes = require('prop-types');
44

55
function ResponseMetadata({ result }) {
66
return (
7-
<div className="hub-reference-results-meta tabber-body-metadata tabber-body"
7+
<div
8+
className="hub-reference-results-meta tabber-body-metadata tabber-body"
89
style={{ display: 'block' }}
9-
>
10+
>
1011
<div className="meta">
1112
{
1213
// eslint-disable-next-line jsx-a11y/label-has-for

packages/api-explorer-ui/src/lib/create-code-shower.js

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,23 @@ module.exports = type => {
1515

1616
if (pathOperation._cache[type]) return pathOperation._cache[type];
1717

18-
const codes = Object.keys(pathOperation.responses || {}).map(status => {
19-
const response = pathOperation.responses[status];
20-
21-
const language = getLanguage(response);
22-
if (!language) return false;
23-
24-
const example = getExample(response, language);
25-
if (!example) return false;
26-
27-
return {
28-
code: typeof example === 'object' ? JSON.stringify(example, undefined, 2) : example,
29-
language,
30-
status,
31-
};
32-
}).filter(Boolean);
18+
const codes = Object.keys(pathOperation.responses || {})
19+
.map(status => {
20+
const response = pathOperation.responses[status];
21+
22+
const language = getLanguage(response);
23+
if (!language) return false;
24+
25+
const example = getExample(response, language);
26+
if (!example) return false;
27+
28+
return {
29+
code: typeof example === 'object' ? JSON.stringify(example, undefined, 2) : example,
30+
language,
31+
status,
32+
};
33+
})
34+
.filter(Boolean);
3335

3436
pathOperation._cache[type] = codes;
3537
return codes;

0 commit comments

Comments
 (0)