lib/main.js
function(formats) {
        for(let format of formats) {
            // TODO: rather than hard coding the mime type use library.spec.base_mime_type
            if(format.mime_type.match(/application\/tsrc\+.+/)) {
                return format;
            }
        }
        return null;
    }
function(formats) {
        for(let format of formats) {
            // TODO: rather than hard coding the mime type use library.spec.base_mime_type
            if(format.mime_type.match(/application\/tsrc\+.+/)) {
                return format;
            }
        }
        return null;
    }
function ( formats ) { for ( let format of formats ) { // TODO: rather than hard coding the mime type use library.spec.base_mime_type if ( format . mime_type . match ( / application\/tsrc\+.+ / ) ) { return format ; } } return null ; }
Returns the first resource container format found in the list.
E.g. the array may contain binary formats such as pdf, mp3, etc. This basically filters those.

@param formats {[]} an array of resource formats
@returns {{}} the resource container format
Returns the first resource container format found in the list . E . g . the array may contain binary formats such as pdf mp3 etc . This basically filters those .