lib/bodystructure.js
function getExtensionFields(node, options) {
    options = options || {};

    var languageString = node.parsedHeader['content-language'] &&
            node.parsedHeader['content-language'].replace(/[ ,]+/g, ',').replace(/^,+|,+$/g, ''),
        language = languageString && languageString.split(',') || null,
        data;

    // if `contentLanguageString` is true, then use a string instead of single element array
    if (language && language.length == 1 && options.contentLanguageString) {
        language = language[0];
    }

    data = [
        // body MD5
        node.parsedHeader['content-md5'] || null,
        // body disposition
        node.parsedHeader['content-disposition'] && [
            options.upperCaseKeys ?
                node.parsedHeader['content-disposition'].value.toUpperCase() :
                node.parsedHeader['content-disposition'].value,
            node.parsedHeader['content-disposition'].params &&
            node.parsedHeader['content-disposition'].hasParams &&
                flatten(Object.keys(node.parsedHeader['content-disposition'].params).map(function(key) {
                    return [
                        options.upperCaseKeys ? key.toUpperCase() : key,
                        node.parsedHeader['content-disposition'].params[key]];
                })) || null
        ] || null,
        // body language
        language
    ];

    // if `skipContentLocation` is true, do not include Content-Location in output
    //
    // NB! RFC3501 has an errata with content-location type, it is described as
    // 'A string list' (eg. an array) in RFC but the errata page states
    // that it is a string (http://www.rfc-editor.org/errata_search.php?rfc=3501)
    // see note for 'Section 7.4.2, page 75'
    if (!options.skipContentLocation) {
        // body location
        data.push(node.parsedHeader['content-location'] || null);
    }

    return data;
}
function getExtensionFields(node, options) {
    options = options || {};

    var languageString = node.parsedHeader['content-language'] &&
            node.parsedHeader['content-language'].replace(/[ ,]+/g, ',').replace(/^,+|,+$/g, ''),
        language = languageString && languageString.split(',') || null,
        data;

    // if `contentLanguageString` is true, then use a string instead of single element array
    if (language && language.length == 1 && options.contentLanguageString) {
        language = language[0];
    }

    data = [
        // body MD5
        node.parsedHeader['content-md5'] || null,
        // body disposition
        node.parsedHeader['content-disposition'] && [
            options.upperCaseKeys ?
                node.parsedHeader['content-disposition'].value.toUpperCase() :
                node.parsedHeader['content-disposition'].value,
            node.parsedHeader['content-disposition'].params &&
            node.parsedHeader['content-disposition'].hasParams &&
                flatten(Object.keys(node.parsedHeader['content-disposition'].params).map(function(key) {
                    return [
                        options.upperCaseKeys ? key.toUpperCase() : key,
                        node.parsedHeader['content-disposition'].params[key]];
                })) || null
        ] || null,
        // body language
        language
    ];

    // if `skipContentLocation` is true, do not include Content-Location in output
    //
    // NB! RFC3501 has an errata with content-location type, it is described as
    // 'A string list' (eg. an array) in RFC but the errata page states
    // that it is a string (http://www.rfc-editor.org/errata_search.php?rfc=3501)
    // see note for 'Section 7.4.2, page 75'
    if (!options.skipContentLocation) {
        // body location
        data.push(node.parsedHeader['content-location'] || null);
    }

    return data;
}
function getExtensionFields ( node , options ) { options = options || { } ; var languageString = node . parsedHeader [ 'content-language' ] && node . parsedHeader [ 'content-language' ] . replace ( / [ ,]+ / g , ',' ) . replace ( / ^,+|,+$ / g , '' ) , language = languageString && languageString . split ( ',' ) || null , data ; // if `contentLanguageString` is true, then use a string instead of single element array if ( language && language . length == 1 && options . contentLanguageString ) { language = language [ 0 ] ; } data = [ // body MD5 node . parsedHeader [ 'content-md5' ] || null , // body disposition node . parsedHeader [ 'content-disposition' ] && [ options . upperCaseKeys ? node . parsedHeader [ 'content-disposition' ] . value . toUpperCase ( ) : node . parsedHeader [ 'content-disposition' ] . value , node . parsedHeader [ 'content-disposition' ] . params && node . parsedHeader [ 'content-disposition' ] . hasParams && flatten ( Object . keys ( node . parsedHeader [ 'content-disposition' ] . params ) . map ( function ( key ) { return [ options . upperCaseKeys ? key . toUpperCase ( ) : key , node . parsedHeader [ 'content-disposition' ] . params [ key ] ] ; } ) ) || null ] || null , // body language language ] ; // if `skipContentLocation` is true, do not include Content-Location in output // // NB! RFC3501 has an errata with content-location type, it is described as // 'A string list' (eg. an array) in RFC but the errata page states // that it is a string (http://www.rfc-editor.org/errata_search.php?rfc=3501) // see note for 'Section 7.4.2, page 75' if ( ! options . skipContentLocation ) { // body location data . push ( node . parsedHeader [ 'content-location' ] || null ) ; } return data ; }
Generates a list of extension fields any non-multipart part should have

@param {Object} node A tree node of the parsed mime tree
@param {Object} [options] Optional options object (see createBodystructure for details)
@return {Array} A list of extension fields
Generates a list of extension fields any non - multipart part should have