Remove redundant if statement (#21101)
Erik committed
Mar 26, 2021 at 17:50 UTC
a5aa9d525345ca3281e027a6f62f212f5feee0cd
1 file changed
+15
-17
packages/react-devtools-shared/src/hydration.js
+15
-17
@@ -243,23 +243,21 @@ export function dehydrate(
243
: data.constructor.name,
244
};
245
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
+ );
261
262
unserializable.push(path);
263