import { pipe } from '../pipe' ; import { View } from '../types/types' ; import { setInMap } from './setInMap' ; /**
 * A lens for zooming in on a map's property. Calling the returned setter with
 * `undefined` removes the key from the map.
 */ export const mapProp = < S , Key , Value > ( key ) => ( { get , set , } ) : View < S , Value | undefined > => ( { get : ( ) => get ( ) . get ( key ) , set : ( value ) => set ( pipe ( get ( ) , setInMap ( key , value ) ) ) , } ) ;