diff --git a/package.json b/package.json index 2d7af31af53..df762e7ed4e 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "jsonwebtoken": "^9.0.2", "launchdarkly-js-client-sdk": "^3.3.0", "lodash.debounce": "^4.0.8", - "lodash.isobject": "^3.0.2", + "lodash.isplainobject": "^4.0.6", "node-polyfill-webpack-plugin": "^2.0.1", "prettier": "^3.3.3", "prism-react-renderer": "^2.1.0", diff --git a/src/components/ParserOpenRPC/InteractiveBox/index.tsx b/src/components/ParserOpenRPC/InteractiveBox/index.tsx index 58e8499813f..252a0412b2b 100644 --- a/src/components/ParserOpenRPC/InteractiveBox/index.tsx +++ b/src/components/ParserOpenRPC/InteractiveBox/index.tsx @@ -27,7 +27,7 @@ import { Tooltip } from "@site/src/components/Tooltip"; import { useColorMode } from "@docusaurus/theme-common"; import { ParserOpenRPCContext } from "@site/src/components/ParserOpenRPC"; import { MetamaskProviderContext } from "@site/src/theme/Root"; -import * as isObject from "lodash.isobject"; +import * as isPlainObject from "lodash.isplainobject"; import { RemoveButton } from "@site/src/components/ParserOpenRPC/InteractiveBox/buttonTemplates/RemoveButton"; import { AddButton } from "@site/src/components/ParserOpenRPC/InteractiveBox/buttonTemplates/AddButton"; @@ -124,14 +124,14 @@ export default function InteractiveBox({ if (name === "Address" || name === "From") { return [checkName(name), metaMaskAccount]; } - if (isObject(value)) { + if (isPlainObject(value)) { return [checkName(name), getObjectWithAddress(value)]; } } - if (isObject(value)) { + if (isPlainObject(value)) { return [ checkName(name), - Object.fromEntries(Object.entries(value).map(([key, val]) => [key, isObject(val) && val?.description ? val.value : val])) + Object.fromEntries(Object.entries(value).map(([key, val]) => [key, isPlainObject(val) && val?.description ? val.value : val])) ]; } return [checkName(name), value]; diff --git a/src/components/ParserOpenRPC/InteractiveBox/templates/WrapIfAdditionalTemplate.tsx b/src/components/ParserOpenRPC/InteractiveBox/templates/WrapIfAdditionalTemplate.tsx index dea1638f6e9..954d0208c7d 100644 --- a/src/components/ParserOpenRPC/InteractiveBox/templates/WrapIfAdditionalTemplate.tsx +++ b/src/components/ParserOpenRPC/InteractiveBox/templates/WrapIfAdditionalTemplate.tsx @@ -2,7 +2,7 @@ import { useContext, useEffect } from "react"; import { ADDITIONAL_PROPERTY_FLAG } from '@rjsf/utils'; import { BaseInputTemplate } from "@site/src/components/ParserOpenRPC/InteractiveBox/templates/BaseInputTemplate"; import { ParserOpenRPCContext } from "@site/src/components/ParserOpenRPC"; -import * as isObject from "lodash.isobject" +import * as isPlainObject from "lodash.isplainobject" export const WrapIfAdditionalTemplate = (props) => { const { @@ -26,7 +26,7 @@ export const WrapIfAdditionalTemplate = (props) => { const { drawerLabel, isComplexTypeView, setIsComplexTypeView, setDrawerLabel } = useContext(ParserOpenRPCContext); const { currentSchemaId, setCurrentSchemaId } = formContext; const onRemoveButtonClick = () => { - if (isObject(formData) && Object.keys(formData).length === 0) { + if (isPlainObject(formData) && Object.keys(formData).length === 0) { setIsComplexTypeView(false); setDrawerLabel(null); } diff --git a/yarn.lock b/yarn.lock index 3918787c787..ff669882d9f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12988,13 +12988,6 @@ __metadata: languageName: node linkType: hard -"lodash.isobject@npm:^3.0.2": - version: 3.0.2 - resolution: "lodash.isobject@npm:3.0.2" - checksum: 6c1667cbc4494d0a13a3617a4b23278d6d02dac520311f2bbb43f16f2cf71d2e6eb9dec8057315b77459df4890c756a256a087d3f4baa44a79ab5d6c968b060e - languageName: node - linkType: hard - "lodash.isplainobject@npm:^4.0.6": version: 4.0.6 resolution: "lodash.isplainobject@npm:4.0.6" @@ -13896,7 +13889,7 @@ __metadata: jsonwebtoken: ^9.0.2 launchdarkly-js-client-sdk: ^3.3.0 lodash.debounce: ^4.0.8 - lodash.isobject: ^3.0.2 + lodash.isplainobject: ^4.0.6 node-polyfill-webpack-plugin: ^2.0.1 prettier: ^3.3.3 prism-react-renderer: ^2.1.0