Skip to content

Commit

Permalink
fix for Flow for native config
Browse files Browse the repository at this point in the history
  • Loading branch information
kassens committed Sep 13, 2022
1 parent 4ece8e6 commit a3f4323
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ function accumulate<T>(
// Both are not empty. Warning: Never call x.concat(y) when you are not
// certain that x is an Array (x could be a string with concat method).
if (isArray(current)) {
/* $FlowFixMe[incompatible-return] if `current` is `T` and `T` an array,
* `isArray` might refine to the array element type of `T` */
return current.concat(next);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ function forEachAccumulated<T>(
scope: ?any,
) {
if (Array.isArray(arr)) {
// $FlowFixMe[incompatible-call] if `T` is an array, `cb` cannot be called
arr.forEach(cb, scope);
} else if (arr) {
cb.call(scope, arr);
Expand Down

0 comments on commit a3f4323

Please sign in to comment.