Skip to content

Commit e2be5c9

Browse files
committed
chore: lint
1 parent ccaf07e commit e2be5c9

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

src/WABinary/generic-utils.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,29 @@ import { type BinaryNode } from './types'
77
const indexCache = new WeakMap<BinaryNode, Map<string, BinaryNode[]>>()
88

99
export const getBinaryNodeChildren = (node: BinaryNode | undefined, childTag: string) => {
10-
if (!node || !Array.isArray(node.content)) return []
10+
if (!node || !Array.isArray(node.content)) return []
1111

12-
let index = indexCache.get(node)
12+
let index = indexCache.get(node)
1313

14-
// Build the index once per node
15-
if (!index) {
16-
index = new Map<string, BinaryNode[]>()
14+
// Build the index once per node
15+
if (!index) {
16+
index = new Map<string, BinaryNode[]>()
1717

18-
for (const child of node.content) {
19-
let arr = index.get(child.tag)
20-
if (!arr) index.set(child.tag, (arr = []))
21-
arr.push(child)
22-
}
18+
for (const child of node.content) {
19+
let arr = index.get(child.tag)
20+
if (!arr) index.set(child.tag, (arr = []))
21+
arr.push(child)
22+
}
2323

24-
indexCache.set(node, index)
25-
}
24+
indexCache.set(node, index)
25+
}
2626

27-
// Return first matching child
28-
return index.get(childTag) || []
27+
// Return first matching child
28+
return index.get(childTag) || []
2929
}
3030

3131
export const getBinaryNodeChild = (node: BinaryNode | undefined, childTag: string) => {
32-
return getBinaryNodeChildren(node, childTag)[0]
32+
return getBinaryNodeChildren(node, childTag)[0]
3333
}
3434

3535
export const getAllBinaryNodeChildren = ({ content }: BinaryNode) => {

0 commit comments

Comments
 (0)