/**
 * Copyright 2018 Twitter, Inc.
 * Licensed under the Apache License, Version 2.0
 * http://www.apache.org/licenses/LICENSE-2.0
 */ export default function mapToObj ( arr , valFn , keyFn = ( item ? ) => item ) { return arr . reduce ( ( result , item ) => Object . assign ( result , { [ keyFn ( item ) ] : valFn ( item ) } ) , { } ) ; }