import { EqualFunction } from '../types/types' ; /**
 * For each key that the two maps do not have equal values for, yields that key
 * along with values that the two maps have for that key (a missing value is
 * represented by `undefined`).
 */ export const diffMaps = function * < Key , Value > ( from , to , equalFunction = ( from , to ) => from === to ) : Iterable < [ key : Key , values : [ from : Value , to : Value ] | [ from : Value , to : undefined ] | [ from : undefined , to : Value ] ] > { for ( const key of to . keys ( ) ) { if ( ! from . has ( key ) || ! equalFunction ( from . get ( key ) ! , to . get ( key ) ! ) ) { yield [ key , [ from . get ( key ) ! , to . get ( key ) ! ] ] ; } } for ( const key of from . keys ( ) ) { if ( ! to . has ( key ) ) { yield [ key , [ from . get ( key ) ! , undefined ] ] ; } } } ;