From 76cb829921d39450321d0b4d746d42ae60ccba2e Mon Sep 17 00:00:00 2001 From: Johannes Klein Date: Wed, 3 Mar 2021 17:58:34 +0100 Subject: [PATCH] Fix a bug that removes the taxon name after a whitespace Fixes #178 --- src/common/fastaParser.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/common/fastaParser.js b/src/common/fastaParser.js index 361d8705..4cb5ee97 100644 --- a/src/common/fastaParser.js +++ b/src/common/fastaParser.js @@ -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(); @@ -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}`); }