Skip to content

Commit

Permalink
chore: minor logic fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Cayla Hamann committed Jun 11, 2020
1 parent 90764ac commit 702dc98
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/hooks/useApiDoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,11 @@ const useApiDoc = (name) => {
return {
name: `${name}.${member}`,
type: api[member] instanceof Array ? 'array' : typeof api[member],
values:
api[member] instanceof Array
? Object.getOwnPropertyNames(api[member]).map(
(key) => `${key}:${JSON.stringify(api[member][key])}`
)
: api[member].map((el) => JSON.stringify(el)),
values: !(api[member] instanceof Array)
? Object.getOwnPropertyNames(api[member]).map(
(key) => `${key}:${JSON.stringify(api[member][key])}`
)
: api[member].map((el) => JSON.stringify(el)),
};
});
};
Expand Down

0 comments on commit 702dc98

Please sign in to comment.