Skip to content

Commit

Permalink
feat: use title to display spectrum name by default (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
lpatiny authored Apr 5, 2024
1 parent abafcf3 commit b43d6d8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/__tests__/createGeneralTOC.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ test('createGeneralTOC', async () => {
.map((file) => {
return statSync(file).size;
});
expect(sizes).toStrictEqual([1221, 384, 566, 483, 250]);
expect(sizes).toStrictEqual([1221, 443, 566, 483, 250]);
});
3 changes: 3 additions & 0 deletions src/__tests__/general/Group1/Data1/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
{
"source": {
"jcampURL": "./1h.jdx"
},
"display": {
"name": "Experiment 1"
}
}
],
Expand Down
8 changes: 3 additions & 5 deletions src/commands/toc/processGeneralFolder.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,9 @@ export async function processGeneralFolder(basename, folder, toc) {
},
};

if (!title) {
spectrum.display = {
name: filename.replace(/^.*\//, ''),
};
}
spectrum.display = {
name: title || filename.replace(/^.*\//, ''),
};

spectra.push(spectrum);
}
Expand Down

0 comments on commit b43d6d8

Please sign in to comment.