Skip to content

Commit

Permalink
fix: faulty isPlainObject
Browse files Browse the repository at this point in the history
  • Loading branch information
abvthecity committed Mar 26, 2024
1 parent 16f12e3 commit 2221a87
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/commons/core-utils/src/objects/isPlainObject.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// https://github.com/lodash/lodash/blob/master/isPlainObject.js
export function isPlainObject(value: unknown): value is Record<string, unknown> {
if (!isObjectLike(value) || String.toString.call(value) !== "[object Object]") {
if (!isObjectLike(value) || String(value) !== "[object Object]") {
return false;
}
if (Object.getPrototypeOf(value) == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,9 @@ export function PlaygroundEndpointFormAside({
{dereferenceObjectProperties(shape, types)
.filter(
(property) =>
formState != null &&
isPlainObject(formState.body) &&
!isUndefined(formState.body[property.key]),
formState?.body?.value != null &&
isPlainObject(formState.body.value) &&
!isUndefined(formState.body.value[property.key]),
)
.map((param) => (
<li key={param.key} id={`link-to/body.${param.key}`}>
Expand Down

0 comments on commit 2221a87

Please sign in to comment.