mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-07-05 12:23:16 +03:00
Update JSONNestedNode.tsx to better handle sparse array inputs
This commit is contained in:
parent
750046c4d9
commit
2160aaa534
|
@ -27,7 +27,7 @@ interface Entry {
|
||||||
}
|
}
|
||||||
|
|
||||||
function isRange(rangeOrEntry: Range | Entry): rangeOrEntry is Range {
|
function isRange(rangeOrEntry: Range | Entry): rangeOrEntry is Range {
|
||||||
return (rangeOrEntry as Range).to !== undefined;
|
return (rangeOrEntry as Range)?.to !== undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderChildNodes(
|
function renderChildNodes(
|
||||||
|
@ -54,6 +54,10 @@ function renderChildNodes(
|
||||||
from,
|
from,
|
||||||
to,
|
to,
|
||||||
).forEach((entry) => {
|
).forEach((entry) => {
|
||||||
|
// Don't process null/undefined entries, which can come from sparse arrays
|
||||||
|
if(!entry) {
|
||||||
|
return
|
||||||
|
}
|
||||||
if (isRange(entry)) {
|
if (isRange(entry)) {
|
||||||
childNodes.push(
|
childNodes.push(
|
||||||
<ItemRange
|
<ItemRange
|
||||||
|
|
Loading…
Reference in New Issue
Block a user