import { Breakpoints } from './Breakpoints' ; example export const findBreakpoint = ( breakpoints , observedSize ? ) : any => { if ( typeof observedSize === 'undefined' ) return undefined ; let breakpoint ; const sizes = Object . keys ( breakpoints ) . map ( key => Number ( key ) ) ; for ( const next of sizes ) { if ( observedSize < next ) break ; breakpoint = next ; } return typeof breakpoint === 'undefined' ? undefined : breakpoints [ breakpoint ] ; } ;