Skip to content

Commit

Permalink
Address PR issues from Bryan
Browse files Browse the repository at this point in the history
  • Loading branch information
goetzrrGit committed Oct 22, 2024
1 parent 3244803 commit b266379
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/utilities/sequence-editor/from-seq-json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function seqJsonVariableToSequence(
sequence += variables
.map(variable => {
const name = variable.name;
const type = variable.type ? ' ' + variable.type : '';
const type = variable.type ? ` ${variable.type}` : '';
const enumName = variable.enum_name ? ' ' + variable.enum_name : '';
const allowableRanges = variable.allowable_ranges
? ` "${variable.allowable_ranges.map(range => `${range.min}...${range.max}`).join(',')}"`
Expand Down
6 changes: 4 additions & 2 deletions src/utilities/sequence-editor/to-seq-json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -567,8 +567,10 @@ function parseAllowableRanges(text: string, rangeNode: any): { max: number; min:
const rangeMatch = /^([-+]?\d+)?(\.\.\.)([-+]?\d+)?$/.exec(range.replaceAll('"', '').trim());
if (rangeMatch) {
const [, min, , max] = rangeMatch;
const maxNum = !isNaN(Number(max)) ? Number(max) : Infinity;
const minNum = !isNaN(Number(min)) ? Number(min) : -Infinity;
const parsedMaxNum = Number(max);
const parsedMinNum = Number(min);
const maxNum = !Number.isNaN(parsedMaxNum) ? parsedMaxNum : Infinity;
const minNum = !Number.isNaN(parsedMinNum) ? parsedMinNum : -Infinity;

return { max: maxNum, min: minNum };
}
Expand Down

0 comments on commit b266379

Please sign in to comment.