Skip to content
This repository was archived by the owner on Apr 13, 2023. It is now read-only.
Merged
Prev Previous commit
Next Next commit
Assign walkTree newContext a default Map
Fixes tests using `walkTree` that aren't passing in a
`newContext` param.
  • Loading branch information
hwillson committed Sep 27, 2018
commit c69bfdf028bfcd43116e560dec8797a1eb8e4c9e
2 changes: 1 addition & 1 deletion src/getDataFromTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export function walkTree(
context: Context,
childContext?: Context,
) => boolean | void,
newContext: Map<any, any>,
newContext: Map<any, any> = new Map(),
) {
if (Array.isArray(element)) {
element.forEach(item => walkTree(item, context, visitor, newContext));
Expand Down