Skip to content

Commit

Permalink
Fix a bug that removes the taxon name after a whitespace
Browse files Browse the repository at this point in the history
Fixes #178
  • Loading branch information
jtklein committed Mar 3, 2021
1 parent 6f58c66 commit 76cb829
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/common/fastaParser.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import UserFixError from "./errors";

export const isFasta = (lines) => {
for (let i = 0; i < lines.length; ++i) {
const line = lines[0].trim();
Expand All @@ -26,7 +24,7 @@ export const parse = (lines) => {
if (line[0] !== '>') {
throw new Error(`Expected a '>' to start a taxon line`);
}
const taxon = line.substring(1).split(' ')[0];
const taxon = line.substring(1);
if (!taxon) {
throw new Error(`Empty taxon at line ${lineIndex + 1}`);
}
Expand Down

0 comments on commit 76cb829

Please sign in to comment.