Skip to content

Commit

Permalink
fix: πŸ› Filter values with provided filter before adding
Browse files Browse the repository at this point in the history
  • Loading branch information
rakannimer committed Oct 10, 2018
1 parent 83064f7 commit 18a5efb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/to-array.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ export function toArray<K, V>(
});
const valueOrNull = !v ? null : v.val();
const keyOrNull = !v ? null : v.key;
array.push(map(keyOrNull, valueOrNull));
if (filter(keyOrNull, valueOrNull)) {
array.push(map(keyOrNull, valueOrNull));
}
return;
});
const unsubChildRemoved = ref.on("child_removed", (v: any) => {
Expand Down

0 comments on commit 18a5efb

Please sign in to comment.