lib/bodystructure.js
function getBasicFields(node, options) {
    var bodyType = node.parsedHeader['content-type'] && node.parsedHeader['content-type'].type || null,
        bodySubtype = node.parsedHeader['content-type'] && node.parsedHeader['content-type'].subtype || null,
        contentTransfer = node.parsedHeader['content-transfer-encoding'] || '7bit';

    return [
        // body type
        options.upperCaseKeys ? bodyType && bodyType.toUpperCase() || null : bodyType,
        // body subtype
        options.upperCaseKeys ? bodySubtype && bodySubtype.toUpperCase() || null : bodySubtype,
        // body parameter parenthesized list
        node.parsedHeader['content-type'] &&
            node.parsedHeader['content-type'].hasParams &&
            flatten(Object.keys(node.parsedHeader['content-type'].params).map(function(key) {
                return [
                    options.upperCaseKeys ? key.toUpperCase() : key,
                    node.parsedHeader['content-type'].params[key]];
            })) || null,
        // body id
        node.parsedHeader['content-id'] || null,
        // body description
        node.parsedHeader['content-description'] || null,
        // body encoding
        options.upperCaseKeys ? contentTransfer && contentTransfer.toUpperCase() || '7bit' : contentTransfer,
        // body size
        node.size
    ];
}
function getBasicFields(node, options) {
    var bodyType = node.parsedHeader['content-type'] && node.parsedHeader['content-type'].type || null,
        bodySubtype = node.parsedHeader['content-type'] && node.parsedHeader['content-type'].subtype || null,
        contentTransfer = node.parsedHeader['content-transfer-encoding'] || '7bit';

    return [
        // body type
        options.upperCaseKeys ? bodyType && bodyType.toUpperCase() || null : bodyType,
        // body subtype
        options.upperCaseKeys ? bodySubtype && bodySubtype.toUpperCase() || null : bodySubtype,
        // body parameter parenthesized list
        node.parsedHeader['content-type'] &&
            node.parsedHeader['content-type'].hasParams &&
            flatten(Object.keys(node.parsedHeader['content-type'].params).map(function(key) {
                return [
                    options.upperCaseKeys ? key.toUpperCase() : key,
                    node.parsedHeader['content-type'].params[key]];
            })) || null,
        // body id
        node.parsedHeader['content-id'] || null,
        // body description
        node.parsedHeader['content-description'] || null,
        // body encoding
        options.upperCaseKeys ? contentTransfer && contentTransfer.toUpperCase() || '7bit' : contentTransfer,
        // body size
        node.size
    ];
}
function getBasicFields ( node , options ) { var bodyType = node . parsedHeader [ 'content-type' ] && node . parsedHeader [ 'content-type' ] . type || null , bodySubtype = node . parsedHeader [ 'content-type' ] && node . parsedHeader [ 'content-type' ] . subtype || null , contentTransfer = node . parsedHeader [ 'content-transfer-encoding' ] || '7bit' ; return [ // body type options . upperCaseKeys ? bodyType && bodyType . toUpperCase ( ) || null : bodyType , // body subtype options . upperCaseKeys ? bodySubtype && bodySubtype . toUpperCase ( ) || null : bodySubtype , // body parameter parenthesized list node . parsedHeader [ 'content-type' ] && node . parsedHeader [ 'content-type' ] . hasParams && flatten ( Object . keys ( node . parsedHeader [ 'content-type' ] . params ) . map ( function ( key ) { return [ options . upperCaseKeys ? key . toUpperCase ( ) : key , node . parsedHeader [ 'content-type' ] . params [ key ] ] ; } ) ) || null , // body id node . parsedHeader [ 'content-id' ] || null , // body description node . parsedHeader [ 'content-description' ] || null , // body encoding options . upperCaseKeys ? contentTransfer && contentTransfer . toUpperCase ( ) || '7bit' : contentTransfer , // body size node . size ] ; }
Generates a list of basic 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 basic fields
Generates a list of basic fields any non - multipart part should have