react-json-tree
Advanced tools
Comparing version
function getLength(type, collection) { | ||
if (type === 'Object') { | ||
// eslint-disable-next-line @typescript-eslint/ban-types | ||
return Object.keys(collection).length; | ||
@@ -5,0 +4,0 @@ } |
@@ -18,3 +18,3 @@ import React, { useCallback, useState } from 'react'; | ||
const { key, value } = entry; | ||
const isCircular = circularCache.indexOf(value) !== -1; | ||
const isCircular = circularCache.includes(value); | ||
childNodes.push(React.createElement(JSONNode, { ...props, postprocessValue, collectionLimit, key: `Node--${key}`, keyPath: [key, ...keyPath], value: postprocessValue(value), circularCache: [...circularCache, value], isCircular: isCircular, hideRoot: false })); | ||
@@ -21,0 +21,0 @@ } |
{ | ||
"name": "react-json-tree", | ||
"version": "0.19.0", | ||
"version": "0.20.0", | ||
"description": "React JSON Viewer Component, Extracted from redux-devtools", | ||
@@ -34,26 +34,19 @@ "keywords": [ | ||
"dependencies": { | ||
"@types/lodash": "^4.17.0", | ||
"@types/lodash": "^4.17.15", | ||
"react-base16-styling": "^0.10.0" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "^29.5.12", | ||
"@types/react": "^18.2.72", | ||
"@types/react-test-renderer": "^18.0.7", | ||
"@typescript-eslint/eslint-plugin": "^7.4.0", | ||
"@typescript-eslint/parser": "^7.4.0", | ||
"eslint": "^8.57.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-jest": "^27.9.0", | ||
"eslint-plugin-react": "^7.34.1", | ||
"eslint-plugin-react-hooks": "^4.6.0", | ||
"@types/jest": "^29.5.14", | ||
"@types/react": "^18.3.18", | ||
"@types/react-test-renderer": "^18.3.1", | ||
"jest": "^29.7.0", | ||
"react": "^18.2.0", | ||
"react-test-renderer": "^18.2.0", | ||
"rimraf": "^5.0.5", | ||
"ts-jest": "^29.1.2", | ||
"typescript": "~5.3.3" | ||
"react": "^18.3.1", | ||
"react-test-renderer": "^18.3.1", | ||
"rimraf": "^6.0.1", | ||
"ts-jest": "^29.2.6", | ||
"typescript": "~5.7.3" | ||
}, | ||
"peerDependencies": { | ||
"@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0", | ||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0" | ||
"@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", | ||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" | ||
}, | ||
@@ -64,3 +57,3 @@ "scripts": { | ||
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js", | ||
"lint": "eslint . --ext .ts,.tsx", | ||
"lint": "eslint .", | ||
"type-check": "tsc --noEmit", | ||
@@ -67,0 +60,0 @@ "prepublish": "pnpm run lint && pnpm run test" |
@@ -5,4 +5,3 @@ import type { SortObjectKeys } from './types.js'; | ||
if (type === 'Object') { | ||
// eslint-disable-next-line @typescript-eslint/ban-types | ||
return Object.keys(collection as {}).length; | ||
return Object.keys(collection as object).length; | ||
} else if (type === 'Array') { | ||
@@ -9,0 +8,0 @@ return (collection as unknown[]).length; |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
9
-43.75%0
-100%63210
-0.63%1622
-0.12%+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
Updated