{"size": 521, "ext": "js", "max_stars_repo_path": "source/map/merge.js", "max_stars_repo_name": "leonp1991/immut", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "source/map/merge.js", "max_issues_repo_name": "leonp1991/immut", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "source/map/merge.js", "max_forks_repo_name": "leonp1991/immut", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 23.6818181818, "max_line_length": 59, "alphanum_fraction": 0.6103646833}
// @flow
import type { Map } from '../consts/types'
import { curry }    from '../utils/curry'
import of           from './of'


/**
 * merges two immutable maps. if the two maps contain a key
 * that is the same, the second maps value will be used
 *
 * @name map.merge
 * @param  {Map} m1 to merge onto
 * @param  {Map} m2 to merge with
 * @return {Map} of merged maps
 * @since 0.0.1
 */
export const merge: (m1: Map, m2: Map) => Map =
  (m1, m2) => of({ ...m1.__data__, ...m2.__data__ })


export default curry(merge)
