mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Remove redundant if statement (#21101)
This commit is contained in:
+15
-17
@@ -243,23 +243,21 @@ export function dehydrate(
|
||||
: data.constructor.name,
|
||||
};
|
||||
|
||||
if (typeof data[Symbol.iterator]) {
|
||||
// TRICKY
|
||||
// Don't use [...spread] syntax for this purpose.
|
||||
// This project uses @babel/plugin-transform-spread in "loose" mode which only works with Array values.
|
||||
// Other types (e.g. typed arrays, Sets) will not spread correctly.
|
||||
Array.from(data).forEach(
|
||||
(item, i) =>
|
||||
(unserializableValue[i] = dehydrate(
|
||||
item,
|
||||
cleaned,
|
||||
unserializable,
|
||||
path.concat([i]),
|
||||
isPathAllowed,
|
||||
isPathAllowedCheck ? 1 : level + 1,
|
||||
)),
|
||||
);
|
||||
}
|
||||
// TRICKY
|
||||
// Don't use [...spread] syntax for this purpose.
|
||||
// This project uses @babel/plugin-transform-spread in "loose" mode which only works with Array values.
|
||||
// Other types (e.g. typed arrays, Sets) will not spread correctly.
|
||||
Array.from(data).forEach(
|
||||
(item, i) =>
|
||||
(unserializableValue[i] = dehydrate(
|
||||
item,
|
||||
cleaned,
|
||||
unserializable,
|
||||
path.concat([i]),
|
||||
isPathAllowed,
|
||||
isPathAllowedCheck ? 1 : level + 1,
|
||||
)),
|
||||
);
|
||||
|
||||
unserializable.push(path);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user