Skip to content

Commit

Permalink
one more try
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeyGirin authored and rrodionov91 committed Jan 23, 2025
1 parent ffac521 commit 21beb73
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
getCdx,
getCdxml,
getCml,
getCml,
getKet,
getMolfile,
getRdf,
Expand Down Expand Up @@ -38,6 +37,9 @@ const fileTypeHandlers: { [key in FileType]: FileTypeHandler } = {
[FileType.CDXML]: getCdxml,
[FileType.SMARTS]: getSmarts,
[FileType.MOL]: getMolfile,
[FileType.RXN]: getRxn,
[FileType.CML]: getCml,
[FileType.SDF]: getSdf,
};


Expand All @@ -51,7 +53,10 @@ async function getFileContent(
if (!handler) {
throw new Error(`Unsupported file type: ${fileType}`);
}
if (fileType === FileType.MOL && typeof fileFormat !== 'undefined') {
if (
(fileType === FileType.MOL || fileType === FileType.RXN) &&
typeof fileFormat !== 'undefined'
) {
return (
handler as (page: Page, fileFormat?: MolfileFormat) => Promise<string>
)(page, fileFormat);
Expand Down

0 comments on commit 21beb73

Please sign in to comment.