Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nafeu/48d2df3572210eadbe4593727907f661 to your computer and use it in GitHub Desktop.
Save nafeu/48d2df3572210eadbe4593727907f661 to your computer and use it in GitHub Desktop.
const isBaseCase = path.length === 1;
if (isBaseCase) {
return existingRows.map((row, index) => {
const isMatchedRowWithoutSubRows = index === Number(id) && !row.subRows;
if (isMatchedRowWithoutSubRows) {
return {
...row,
subRows: subRowsToInsert
}
}
return row;
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment