lib/collection/property-list.js
function (excludeDisabled, caseSensitive, multiValue, sanitizeKeys) {
        var obj = {}, // create transformation data accumulator

            // gather all the switches of the list
            key = this._postman_listIndexKey,
            sanitiseKeys = this._postman_sanitizeKeys || sanitizeKeys,
            sensitive = !this._postman_listIndexCaseInsensitive || caseSensitive,
            multivalue = this._postman_listAllowsMultipleValues || multiValue;

        // iterate on each member to create the transformation object
        this.each(function (member) {
            // Bail out for the current member if ANY of the conditions below is true:
            // 1. The member is falsy.
            // 2. The member does not have the specified property list index key.
            // 3. The member is disabled and disabled properties have to be ignored.
            // 4. The member has a falsy key, and sanitize is true.
            if (!member || !member.hasOwnProperty(key) || (excludeDisabled && member.disabled) ||
                (sanitiseKeys && !member[key])) {
                return;
            }

            // based on case sensitivity settings, we get the property name of the item
            var prop = sensitive ? member[key] : String(member[key]).toLowerCase();

            // now, if transformation object already has a member with same property name, we either overwrite it or
            // append to an array of values based on multi-value support
            if (multivalue && obj.hasOwnProperty(prop)) {
                (!Array.isArray(obj[prop])) && (obj[prop] = [obj[prop]]);
                obj[prop].push(member.valueOf());
            }
            else {
                obj[prop] = member.valueOf();
            }
        });

        return obj;
    }
function (excludeDisabled, caseSensitive, multiValue, sanitizeKeys) {
        var obj = {}, // create transformation data accumulator

            // gather all the switches of the list
            key = this._postman_listIndexKey,
            sanitiseKeys = this._postman_sanitizeKeys || sanitizeKeys,
            sensitive = !this._postman_listIndexCaseInsensitive || caseSensitive,
            multivalue = this._postman_listAllowsMultipleValues || multiValue;

        // iterate on each member to create the transformation object
        this.each(function (member) {
            // Bail out for the current member if ANY of the conditions below is true:
            // 1. The member is falsy.
            // 2. The member does not have the specified property list index key.
            // 3. The member is disabled and disabled properties have to be ignored.
            // 4. The member has a falsy key, and sanitize is true.
            if (!member || !member.hasOwnProperty(key) || (excludeDisabled && member.disabled) ||
                (sanitiseKeys && !member[key])) {
                return;
            }

            // based on case sensitivity settings, we get the property name of the item
            var prop = sensitive ? member[key] : String(member[key]).toLowerCase();

            // now, if transformation object already has a member with same property name, we either overwrite it or
            // append to an array of values based on multi-value support
            if (multivalue && obj.hasOwnProperty(prop)) {
                (!Array.isArray(obj[prop])) && (obj[prop] = [obj[prop]]);
                obj[prop].push(member.valueOf());
            }
            else {
                obj[prop] = member.valueOf();
            }
        });

        return obj;
    }
function ( excludeDisabled , caseSensitive , multiValue , sanitizeKeys ) { var obj = { } , // create transformation data accumulator // gather all the switches of the list key = this . _postman_listIndexKey , sanitiseKeys = this . _postman_sanitizeKeys || sanitizeKeys , sensitive = ! this . _postman_listIndexCaseInsensitive || caseSensitive , multivalue = this . _postman_listAllowsMultipleValues || multiValue ; // iterate on each member to create the transformation object this . each ( function ( member ) { // Bail out for the current member if ANY of the conditions below is true: // 1. The member is falsy. // 2. The member does not have the specified property list index key. // 3. The member is disabled and disabled properties have to be ignored. // 4. The member has a falsy key, and sanitize is true. if ( ! member || ! member . hasOwnProperty ( key ) || ( excludeDisabled && member . disabled ) || ( sanitiseKeys && ! member [ key ] ) ) { return ; } // based on case sensitivity settings, we get the property name of the item var prop = sensitive ? member [ key ] : String ( member [ key ] ) . toLowerCase ( ) ; // now, if transformation object already has a member with same property name, we either overwrite it or // append to an array of values based on multi-value support if ( multivalue && obj . hasOwnProperty ( prop ) ) { ( ! Array . isArray ( obj [ prop ] ) ) && ( obj [ prop ] = [ obj [ prop ] ] ) ; obj [ prop ] . push ( member . valueOf ( ) ) ; } else { obj [ prop ] = member . valueOf ( ) ; } } ) ; return obj ; }
Converts a list of Properties into an object where key is `_postman_propertyIndexKey` and value is determined
by the `valueOf` function

@param {?Boolean} [excludeDisabled=false] - When set to true, disabled properties are excluded from the resultant
object.
@param {?Boolean} [caseSensitive] - When set to true, properties are treated strictly as per their original
case. The default value for this property also depends on the case insensitivity definition of the current
property.
@param {?Boolean} [multiValue=false] - When set to true, only the first value of a multi valued property is
returned.
@param {Boolean} [sanitizeKeys=false] - When set to true, properties with falsy keys are removed.
@todo Change the function signature to an object of options instead of the current structure.
@return {Object}
Converts a list of Properties into an object where key is _postman_propertyIndexKey and value is determined by the valueOf function