Skip to content

Commit

Permalink
🔧 imporve logging for probelmatic keys
Browse files Browse the repository at this point in the history
  • Loading branch information
evans-g-crsj committed Feb 26, 2024
1 parent 73dd606 commit 41f2c10
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions admin/addFieldsToStudies.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,14 @@ const mappingSeemsValid = m.dataset.type === 'nested' && mappedKeys.every(x => !
if (!mappingSeemsValid) {
console.error('It seems like not all values are mapped correctly.');
if (m.dataset.type === 'nested') {
console.error(
'Problematic keys per study: ',
mappedKeys.filter(x => !x[0]),
);
console.error('Problematic keys per study: ', [
...new Set(
mappedKeys
.filter(x => !x[0])
.map(x => x[1])
.flat(),
),
]);
}
process.exit(0);
}
Expand Down

0 comments on commit 41f2c10

Please sign in to comment.