Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
parseListData: function( responseData ) {
// call any base parseListData
if(baseConnect.parseListData) {
responseData = baseConnect.parseListData.apply(this, arguments);
}
var result;
if( isArray(responseData) ) {
result = {data: responseData};
} else {
var prop = this.parseListProp || 'data';
responseData.data = helpers.getObject(prop, responseData);
result = responseData;
if(prop !== "data") {
delete responseData[prop];
}
if(!isArray(result.data)) {
throw new Error('Could not get any raw data while converting using .parseListData');
}
}
var arr = [];
for(var i =0 ; i < result.data.length; i++) {
module.exports = function(data){
if(isArray(data)) {
return data;
} else {
return data.data;
}
};
if(baseConnect.parseListData) {
responseData = baseConnect.parseListData.apply(this, arguments);
}
var result;
if( isArray(responseData) ) {
result = {data: responseData};
} else {
var prop = this.parseListProp || 'data';
responseData.data = helpers.getObject(prop, responseData);
result = responseData;
if(prop !== "data") {
delete responseData[prop];
}
if(!isArray(result.data)) {
throw new Error('Could not get any raw data while converting using .parseListData');
}
}
var arr = [];
for(var i =0 ; i < result.data.length; i++) {
arr.push( this.parseInstanceData(result.data[i]) );
}
result.data = arr;
return result;
},
/**