mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-07-27 08:30:02 +03:00
map2tree
This commit is contained in:
parent
9bf0779f7b
commit
020cdff7d5
|
@ -45,9 +45,9 @@ export function map2tree(
|
|||
root: unknown,
|
||||
options: { key?: string; pushMethod?: 'push' | 'unshift' } = {},
|
||||
tree: Node = { name: options.key || 'state', children: [] },
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
): Node | {} {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
if (!isPlainObject(root) && root && !(root as { toJS: () => {} }).toJS) {
|
||||
return {};
|
||||
}
|
||||
|
@ -60,13 +60,13 @@ export function map2tree(
|
|||
}
|
||||
|
||||
mapValues(
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
root && (root as { toJS: () => {} }).toJS
|
||||
? // eslint-disable-next-line @typescript-eslint/ban-types
|
||||
? // eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
(root as { toJS: () => {} }).toJS()
|
||||
: // eslint-disable-next-line @typescript-eslint/ban-types
|
||||
: // eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
(root as {}),
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
(maybeImmutable: { toJS?: () => {} }, key) => {
|
||||
const value =
|
||||
maybeImmutable && maybeImmutable.toJS
|
||||
|
|
Loading…
Reference in New Issue
Block a user