Skip to content

Commit a5aa9d5

Browse files
author
Erik
authored
Remove redundant if statement (#21101)
1 parent a77dd13 commit a5aa9d5

File tree

1 file changed

+15
-17
lines changed

1 file changed

+15
-17
lines changed

packages/react-devtools-shared/src/hydration.js

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -243,23 +243,21 @@ export function dehydrate(
243243
: data.constructor.name,
244244
};
245245

246-
if (typeof data[Symbol.iterator]) {
247-
// TRICKY
248-
// Don't use [...spread] syntax for this purpose.
249-
// This project uses @babel/plugin-transform-spread in "loose" mode which only works with Array values.
250-
// Other types (e.g. typed arrays, Sets) will not spread correctly.
251-
Array.from(data).forEach(
252-
(item, i) =>
253-
(unserializableValue[i] = dehydrate(
254-
item,
255-
cleaned,
256-
unserializable,
257-
path.concat([i]),
258-
isPathAllowed,
259-
isPathAllowedCheck ? 1 : level + 1,
260-
)),
261-
);
262-
}
246+
// TRICKY
247+
// Don't use [...spread] syntax for this purpose.
248+
// This project uses @babel/plugin-transform-spread in "loose" mode which only works with Array values.
249+
// Other types (e.g. typed arrays, Sets) will not spread correctly.
250+
Array.from(data).forEach(
251+
(item, i) =>
252+
(unserializableValue[i] = dehydrate(
253+
item,
254+
cleaned,
255+
unserializable,
256+
path.concat([i]),
257+
isPathAllowed,
258+
isPathAllowedCheck ? 1 : level + 1,
259+
)),
260+
);
263261

264262
unserializable.push(path);
265263

0 commit comments

Comments
 (0)