lib/converters/v1.0.0/converter-v1-to-v2.js
function (collectionV1) {
        var self = this,
            requestsCache = _.keyBy(collectionV1.requests, 'id'),
            allRequests = _.map(collectionV1.requests, 'id'),
            result;

        self.cache = requestsCache;
        result = self.itemGroups(collectionV1);

        _.forEach(_.intersection(collectionV1.order, allRequests), function (requestId) {
            var request = self.singleItem(requestsCache[requestId]);

            request && (result.push(request));
        });

        return result;
    }
function (collectionV1) {
        var self = this,
            requestsCache = _.keyBy(collectionV1.requests, 'id'),
            allRequests = _.map(collectionV1.requests, 'id'),
            result;

        self.cache = requestsCache;
        result = self.itemGroups(collectionV1);

        _.forEach(_.intersection(collectionV1.order, allRequests), function (requestId) {
            var request = self.singleItem(requestsCache[requestId]);

            request && (result.push(request));
        });

        return result;
    }
function ( collectionV1 ) { var self = this , requestsCache = _ . keyBy ( collectionV1 . requests , 'id' ) , allRequests = _ . map ( collectionV1 . requests , 'id' ) , result ; self . cache = requestsCache ; result = self . itemGroups ( collectionV1 ) ; _ . forEach ( _ . intersection ( collectionV1 . order , allRequests ) , function ( requestId ) { var request = self . singleItem ( requestsCache [ requestId ] ) ; request && ( result . push ( request ) ) ; } ) ; return result ; }
Creates a V2 compatible array of items from a V1 Postman Collection

@param {Object} collectionV1 - A Postman Collection object in the V1 format.
@returns {Object[]} - The list of item groups (folders) in v2 format.
Creates a V2 compatible array of items from a V1 Postman Collection