We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6932cae commit 52d7fc4Copy full SHA for 52d7fc4
src/a11y-snapshot.ts
@@ -18,14 +18,12 @@ const flattenContainers = (nodes: AXNode[]) =>
18
}, [])
19
20
const removeEmpty = ({ children = [], ...node }: AXNode): AXNode => {
21
- const newNode = Object.keys(node).reduce(
22
- (acc, key) => {
23
- const value = (node as any)[key]
24
-
25
- return value === '' ? acc : { ...acc, [key]: value }
26
- },
27
- {} as AXNode,
28
- )
+ const initialNode: AXNode = {} as any
+ const newNode = Object.keys(node).reduce((acc, key) => {
+ const value = (node as any)[key]
+
+ return value === '' ? acc : { ...acc, [key]: value }
+ }, initialNode)
29
30
const flattenedChildren = flattenContainers(children)
31
0 commit comments