Skip to content

Commit

Permalink
Removed isNaN check as regex prevents number from being NaN
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanrenwick committed Nov 18, 2019
1 parent 473606a commit 4559f8f
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ const regex = new RegExp("^(\\d+) ?([a-zA-Z]+)");

function matchToTimespan(match) {
let quantity = parseInt(match[1]);
if (Number.isNaN(quantity)) return -1;
let type = match[2].toLowerCase();
let typeIndex = timeStrings.indexOf(type);
if (typeIndex === -1 && type.length === 1) typeIndex = timeStrings.map(x => x[0]).indexOf(type);
Expand Down

0 comments on commit 4559f8f

Please sign in to comment.