interface ObjectFromEntries { < Key extends string | number | symbol , Value > ( source ) : Record < Key , Value > ; } export const objectFromEntriesPonyfill = ( ( source ) => { const result = { } ; for ( const [ key , value ] of source ) { result [ key ] = value ; } return result ; } ) as ObjectFromEntries ; /**
 * Converts an iterable of key-value pairs to an object. The same as
 * Object.fromEntries, but is better typed.
 */ export const objectFromEntries = ( Object as any ) . fromEntries ?? objectFromEntriesPonyfill ;