Skip to content

Commit

Permalink
fix: ensure string in data version
Browse files Browse the repository at this point in the history
  • Loading branch information
jobo322 committed Sep 10, 2023
1 parent 6c82849 commit 91f0dd1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/NmrRecord.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ export const getNMReData = (sdf) => {
export const getNMReDataTags = (sdf) => {
let sdfFile = checkSdf(sdf);
let version = parseFloat(sdfFile.molecules[0].NMREDATA_VERSION);
let toReplace = version > 1 ? [new RegExp(/\\\n*/g), '\n'] : [];

let nmredataTags = {};
for (let tag of sdfFile.labels) {
Expand All @@ -183,7 +182,7 @@ export const getNMReDataTags = (sdf) => {
version > 1
? sdfFile.molecules[0][tag].replace(/\n*/g, '')
: sdfFile.molecules[0][tag];
data = data.replace(toReplace[0], toReplace[1]);
data = String(data).replace(/\\\n*/g, '\n');
nmredataTags[key] = data;
}
}
Expand Down

0 comments on commit 91f0dd1

Please sign in to comment.