function guessMimeTypes(path, firstLine) {
    if (!path) {
        return [MIME_UNKNOWN];
    }
    path = path.toLowerCase();
    var filename = paths.basename(path);
    // 1.) User configured mappings have highest priority
    var configuredMime = guessMimeTypeByPath(path, filename, userRegisteredAssociations);
    if (configuredMime) {
        return [configuredMime, MIME_TEXT];
    }
    // 2.) Registered mappings have middle priority
    var registeredMime = guessMimeTypeByPath(path, filename, nonUserRegisteredAssociations);
    if (registeredMime) {
        return [registeredMime, MIME_TEXT];
    }
    // 3.) Firstline has lowest priority
    if (firstLine) {
        var firstlineMime = guessMimeTypeByFirstline(firstLine);
        if (firstlineMime) {
            return [firstlineMime, MIME_TEXT];
        }
    }
    return [MIME_UNKNOWN];
}
/**
 * Given a file, return the best matching mime type for it
 */
Given a file, return the best matching mime type for it
Given a file return the best matching mime type for it
function guessMimeTypes(path, firstLine) {
    if (!path) {
        return [MIME_UNKNOWN];
    }
    path = path.toLowerCase();
    var filename = paths.basename(path);
    var configuredMime = guessMimeTypeByPath(path, filename, userRegisteredAssociations);
    if (configuredMime) {
        return [configuredMime, MIME_TEXT];
    }
    var registeredMime = guessMimeTypeByPath(path, filename, nonUserRegisteredAssociations);
    if (registeredMime) {
        return [registeredMime, MIME_TEXT];
    }
    if (firstLine) {
        var firstlineMime = guessMimeTypeByFirstline(firstLine);
        if (firstlineMime) {
            return [firstlineMime, MIME_TEXT];
        }
    }
    return [MIME_UNKNOWN];
}
function guessMimeTypes ( path , firstLine ) { if ( ! path ) { return [ MIME_UNKNOWN ] ; } path = path . toLowerCase ( ) ; var filename = paths . basename ( path ) ; var configuredMime = guessMimeTypeByPath ( path , filename , userRegisteredAssociations ) ; if ( configuredMime ) { return [ configuredMime , MIME_TEXT ] ; } var registeredMime = guessMimeTypeByPath ( path , filename , nonUserRegisteredAssociations ) ; if ( registeredMime ) { return [ registeredMime , MIME_TEXT ] ; } if ( firstLine ) { var firstlineMime = guessMimeTypeByFirstline ( firstLine ) ; if ( firstlineMime ) { return [ firstlineMime , MIME_TEXT ] ; } } return [ MIME_UNKNOWN ] ; }
Given a file, return the best matching mime type for it
Given a file return the best matching mime type for it
// 1.) User configured mappings have highest priority // 2.) Registered mappings have middle priority // 3.) Firstline has lowest priority