Skip to content

Commit 787cbb2

Browse files
authored
fix(docs): fixed check for object (#1578)
1 parent 7d998fe commit 787cbb2

File tree

4 files changed

+8
-15
lines changed

4 files changed

+8
-15
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"jsonwebtoken": "^9.0.2",
5555
"launchdarkly-js-client-sdk": "^3.3.0",
5656
"lodash.debounce": "^4.0.8",
57-
"lodash.isobject": "^3.0.2",
57+
"lodash.isplainobject": "^4.0.6",
5858
"node-polyfill-webpack-plugin": "^2.0.1",
5959
"prettier": "^3.3.3",
6060
"prism-react-renderer": "^2.1.0",

src/components/ParserOpenRPC/InteractiveBox/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import { Tooltip } from "@site/src/components/Tooltip";
2727
import { useColorMode } from "@docusaurus/theme-common";
2828
import { ParserOpenRPCContext } from "@site/src/components/ParserOpenRPC";
2929
import { MetamaskProviderContext } from "@site/src/theme/Root";
30-
import * as isObject from "lodash.isobject";
30+
import * as isPlainObject from "lodash.isplainobject";
3131
import { RemoveButton } from "@site/src/components/ParserOpenRPC/InteractiveBox/buttonTemplates/RemoveButton";
3232
import { AddButton } from "@site/src/components/ParserOpenRPC/InteractiveBox/buttonTemplates/AddButton";
3333

@@ -124,14 +124,14 @@ export default function InteractiveBox({
124124
if (name === "Address" || name === "From") {
125125
return [checkName(name), metaMaskAccount];
126126
}
127-
if (isObject(value)) {
127+
if (isPlainObject(value)) {
128128
return [checkName(name), getObjectWithAddress(value)];
129129
}
130130
}
131-
if (isObject(value)) {
131+
if (isPlainObject(value)) {
132132
return [
133133
checkName(name),
134-
Object.fromEntries(Object.entries(value).map(([key, val]) => [key, isObject(val) && val?.description ? val.value : val]))
134+
Object.fromEntries(Object.entries(value).map(([key, val]) => [key, isPlainObject(val) && val?.description ? val.value : val]))
135135
];
136136
}
137137
return [checkName(name), value];

src/components/ParserOpenRPC/InteractiveBox/templates/WrapIfAdditionalTemplate.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useContext, useEffect } from "react";
22
import { ADDITIONAL_PROPERTY_FLAG } from '@rjsf/utils';
33
import { BaseInputTemplate } from "@site/src/components/ParserOpenRPC/InteractiveBox/templates/BaseInputTemplate";
44
import { ParserOpenRPCContext } from "@site/src/components/ParserOpenRPC";
5-
import * as isObject from "lodash.isobject"
5+
import * as isPlainObject from "lodash.isplainobject"
66

77
export const WrapIfAdditionalTemplate = (props) => {
88
const {
@@ -26,7 +26,7 @@ export const WrapIfAdditionalTemplate = (props) => {
2626
const { drawerLabel, isComplexTypeView, setIsComplexTypeView, setDrawerLabel } = useContext(ParserOpenRPCContext);
2727
const { currentSchemaId, setCurrentSchemaId } = formContext;
2828
const onRemoveButtonClick = () => {
29-
if (isObject(formData) && Object.keys(formData).length === 0) {
29+
if (isPlainObject(formData) && Object.keys(formData).length === 0) {
3030
setIsComplexTypeView(false);
3131
setDrawerLabel(null);
3232
}

yarn.lock

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12988,13 +12988,6 @@ __metadata:
1298812988
languageName: node
1298912989
linkType: hard
1299012990

12991-
"lodash.isobject@npm:^3.0.2":
12992-
version: 3.0.2
12993-
resolution: "lodash.isobject@npm:3.0.2"
12994-
checksum: 6c1667cbc4494d0a13a3617a4b23278d6d02dac520311f2bbb43f16f2cf71d2e6eb9dec8057315b77459df4890c756a256a087d3f4baa44a79ab5d6c968b060e
12995-
languageName: node
12996-
linkType: hard
12997-
1299812991
"lodash.isplainobject@npm:^4.0.6":
1299912992
version: 4.0.6
1300012993
resolution: "lodash.isplainobject@npm:4.0.6"
@@ -13896,7 +13889,7 @@ __metadata:
1389613889
jsonwebtoken: ^9.0.2
1389713890
launchdarkly-js-client-sdk: ^3.3.0
1389813891
lodash.debounce: ^4.0.8
13899-
lodash.isobject: ^3.0.2
13892+
lodash.isplainobject: ^4.0.6
1390013893
node-polyfill-webpack-plugin: ^2.0.1
1390113894
prettier: ^3.3.3
1390213895
prism-react-renderer: ^2.1.0

0 commit comments

Comments
 (0)