Skip to content

Commit

Permalink
Merge pull request #341 from youngbob/fix-invalid-array-length
Browse files Browse the repository at this point in the history
looks good, tests are passing locally.
  • Loading branch information
mac-s-g committed Mar 9, 2021
2 parents 34c3994 + 7f3f480 commit 8e6819d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/js/components/JsonViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ export default class extends React.PureComponent {
const namespace = [props.name];
let ObjectComponent = JsonObject;

const size = Array.isArray(props.src)
? props.src.length
: Object.keys(props.src).length;
if (
Array.isArray(props.src) &&
props.groupArraysAfterLength &&
size > props.groupArraysAfterLength
props.src.length > props.groupArraysAfterLength
) {
ObjectComponent = ArrayGroup;
}
Expand Down

0 comments on commit 8e6819d

Please sign in to comment.