/**
 * Copyright (c) 2016-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */ export function zip2 < A , B > ( a , b ) { const length = Math . min ( a . length , b . length ) ; const result = [ ] ; for ( let i = 0 ; i < length ; i ++ ) { result . push ( [ a [ i ] , b [ i ] ] ) ; } return result ; } export function flatMap < T , R > ( array , func ) { return array . reduce < R [ ] > ( ( current , next ) => current . concat ( func ( next ) ) , [ ] ) ; }