react-json-tree

This commit is contained in:
Nathan Bierema 2024-08-04 19:40:07 -04:00
parent e025d2af40
commit c1e623d4a6
2 changed files with 2 additions and 3 deletions

View File

@ -66,7 +66,7 @@ function renderChildNodes(
); );
} else { } else {
const { key, value } = entry; const { key, value } = entry;
const isCircular = circularCache.indexOf(value) !== -1; const isCircular = circularCache.includes(value);
childNodes.push( childNodes.push(
<JSONNode <JSONNode

View File

@ -2,8 +2,7 @@ import type { SortObjectKeys } from './types.js';
function getLength(type: string, collection: unknown) { function getLength(type: string, collection: unknown) {
if (type === 'Object') { if (type === 'Object') {
// eslint-disable-next-line @typescript-eslint/ban-types return Object.keys(collection as object).length;
return Object.keys(collection as {}).length;
} else if (type === 'Array') { } else if (type === 'Array') {
return (collection as unknown[]).length; return (collection as unknown[]).length;
} }