lib/converters/v1.0.0/converter-v1-to-v2.js
function (requestV1) {
        if (!requestV1) { return; }

        var self = this,
            units = ['request', 'response'],
            variable = self.variable(requestV1),
            item = {
                name: requestV1.name || '', // Inline building to avoid additional function call
                event: self.event(requestV1)
            };

        self.options.retainIds && (item._postman_id = requestV1.id || util.uid());
        // add protocolProfileBehavior property from requestV1 to the item
        util.addProtocolProfileBehavior(requestV1, item);

        units.forEach(function (unit) {
            item[unit] = self[unit](requestV1);
        });

        variable && variable.length && (item.variable = variable);

        return item;
    }
function (requestV1) {
        if (!requestV1) { return; }

        var self = this,
            units = ['request', 'response'],
            variable = self.variable(requestV1),
            item = {
                name: requestV1.name || '', // Inline building to avoid additional function call
                event: self.event(requestV1)
            };

        self.options.retainIds && (item._postman_id = requestV1.id || util.uid());
        // add protocolProfileBehavior property from requestV1 to the item
        util.addProtocolProfileBehavior(requestV1, item);

        units.forEach(function (unit) {
            item[unit] = self[unit](requestV1);
        });

        variable && variable.length && (item.variable = variable);

        return item;
    }
function ( requestV1 ) { if ( ! requestV1 ) { return ; } var self = this , units = [ 'request' , 'response' ] , variable = self . variable ( requestV1 ) , item = { name : requestV1 . name || '' , // Inline building to avoid additional function call event : self . event ( requestV1 ) } ; self . options . retainIds && ( item . _postman_id = requestV1 . id || util . uid ( ) ) ; // add protocolProfileBehavior property from requestV1 to the item util . addProtocolProfileBehavior ( requestV1 , item ) ; units . forEach ( function ( unit ) { item [ unit ] = self [ unit ] ( requestV1 ) ; } ) ; variable && variable . length && ( item . variable = variable ) ; return item ; }
Creates a V2 compatible ``item`` from a V1 Postman Collection Request

@param {Object} requestV1 - Postman collection V1 request.
@returns {Object} - The converted request object, in v2 format.
Creates a V2 compatible item from a V1 Postman Collection Request