Skip to content

Commit

Permalink
Prettify files for release
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielliwerant committed Oct 17, 2019
1 parent 3badde4 commit fd9fbac
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/MUIDataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -463,11 +463,17 @@ class MUIDataTable extends React.Component {
})
: data.map(row => columns.map(col => leaf(row, col.name)));

// We need to determine if object data exists in the transformed structure, as this is currently not allowed
const hasInvalidData = transformedData.filter(data => data.filter(d => typeof d === 'object' && d !== null && !Array.isArray(d)).length > 0).length > 0;
if (hasInvalidData) throw Error(`Cannot accept objects for cell data. Cells need to contain strings | numbers. It\'s possible this error is the result of a missing dot in the column name field (e.g. name: "company" instead of name: "company.id")`);
// We need to determine if object data exists in the transformed structure, as this is currently not allowed
const hasInvalidData =
transformedData.filter(
data => data.filter(d => typeof d === 'object' && d !== null && !Array.isArray(d)).length > 0,
).length > 0;
if (hasInvalidData)
throw Error(
`Cannot accept objects for cell data. Cells need to contain strings | numbers. It\'s possible this error is the result of a missing dot in the column name field (e.g. name: "company" instead of name: "company.id")`,
);

return transformedData;
return transformedData;
};

setTableData(props, status, callback = () => {}) {
Expand Down

0 comments on commit fd9fbac

Please sign in to comment.