function getMediaType(matchMedia, mediaQueries, infinityMediaType) {
    // if there's no window
    if (typeof matchMedia === 'undefined') {
        // return the infinity media type
        return infinityMediaType
    }

    // there is a window, so compute the true media type
    return Object.keys(mediaQueries).reduce((result, query) => {
        // return the new type if the query matches otherwise the previous one
        return matchMedia(mediaQueries[query]).matches ? query : result
        // use the infinity media type
    }, infinityMediaType)
}
Gets the current media type from the global `window`.
@arg {object} mediaQueries - The media queries object.
@arg {string} infinityMediaType - The infinity media type.
@returns {string} The window's current media type.  This is the key of the
breakpoint that is the next breakpoint larger than the window.