import { Record , RecordMap } from '../types' ; param { Record [ ] } records . The example export const indexById = ( records = [ ] ) : RecordMap => records . filter ( r => typeof r !== 'undefined' ) . reduce ( ( prev , current ) => { prev [ current . id ] = current ; return prev ; } , { } ) ;