Skip to content

Commit

Permalink
fix(utils): getRelativeNumber ignores whitespace (fixes #336)
Browse files Browse the repository at this point in the history
  • Loading branch information
seleb committed Nov 17, 2022
1 parent 6cda046 commit a2dc72f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/helpers/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export function printDialog(environment, text, onReturn) {
*/
export function getRelativeNumber(value, relativeTo) {
var v = value || value === 0 ? value : relativeTo;
if (typeof v === 'string') v = v.trim();
if (typeof v === 'string' && (v.startsWith('+') || v.startsWith('-'))) {
return relativeTo + Number(v);
}
Expand Down

0 comments on commit a2dc72f

Please sign in to comment.