lib/cocos2d/mimetypes.js
function read(file) {
    var data = fs.readFileSync(file, 'ascii');
    // Strip comments
    data = data.replace(/#.*/g, '');
    var lines = data.split('\n');
    for (var i = 0, len = lines.length; i < len; i++) {
        var line = lines[i].trim();
        if (!line) {
            continue;
        }

        var words = line.split(/\s/),
            type = words.shift(),
            suffixes = words;

        for (var j = 0, jen = suffixes.length; j < jen; j++) {
            var suff = suffixes[j].trim();
            if (!suff) {
                continue;
            }

            addType(type, '.' + suff);
        }
    }
}
function read(file) {
    var data = fs.readFileSync(file, 'ascii');
    // Strip comments
    data = data.replace(/#.*/g, '');
    var lines = data.split('\n');
    for (var i = 0, len = lines.length; i < len; i++) {
        var line = lines[i].trim();
        if (!line) {
            continue;
        }

        var words = line.split(/\s/),
            type = words.shift(),
            suffixes = words;

        for (var j = 0, jen = suffixes.length; j < jen; j++) {
            var suff = suffixes[j].trim();
            if (!suff) {
                continue;
            }

            addType(type, '.' + suff);
        }
    }
}
function read ( file ) { var data = fs . readFileSync ( file , 'ascii' ) ; // Strip comments data = data . replace ( / #.* / g , '' ) ; var lines = data . split ( '\n' ) ; for ( var i = 0 , len = lines . length ; i < len ; i ++ ) { var line = lines [ i ] . trim ( ) ; if ( ! line ) { continue ; } var words = line . split ( / \s / ) , type = words . shift ( ) , suffixes = words ; for ( var j = 0 , jen = suffixes . length ; j < jen ; j ++ ) { var suff = suffixes [ j ] . trim ( ) ; if ( ! suff ) { continue ; } addType ( type , '.' + suff ) ; } } }
Read a single mime.types-format file
Read a single mime . types - format file