Skip to content

Commit

Permalink
fix: sdf parser result contains the extension
Browse files Browse the repository at this point in the history
  • Loading branch information
jobo322 committed Sep 21, 2023
1 parent b522a06 commit e5976f9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/util/getSDF.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ export async function getSDF(files) {
for (const file of files) {
const pathFile = file.relativePath.split('/');
if (/^[^.].+sdf|nmredata$/.exec(file.name)) {
const filename = file.name.replace(/\.sdf|nmredata/, '');
const root = pathFile.slice(0, pathFile.length - 1).join('/');
const sdf = await file.text();

if (!sdf.match('NMREDATA')) continue;

let parserResult = parseSDF(`${sdf}`, { mixedEOL: true });
parserResult.filename = filename;
parserResult.root = root !== '' ? `${root}/` : '';
result.push(parserResult);
const parserResult = parseSDF(`${sdf}`, { mixedEOL: true });
const root = pathFile.slice(0, pathFile.length - 1).join('/');
result.push({
...parserResult,
filename: file.name,
root: root !== '' ? `${root}/` : '',
});
}
}
return result;
Expand Down

0 comments on commit e5976f9

Please sign in to comment.