Skip to content

Commit 575bf33

Browse files
committed
add optionally removing a dot before non-numeric characters
1 parent 57b270f commit 575bf33

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dash/dash-renderer/src/components/error/menu/VersionInfo.react.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ const DAY_IN_MS = 86400000;
77
function compareVersions(v1, v2) {
88
// Remove any non-numeric characters from the version strings
99
// and anything after them (e.g. 1.2.3-rc.1 -> 1.2.3, 1.2.3+build.1 -> 1.2.3)
10-
v1 = v1.replace(/[^0-9.].*$/, '');
11-
v2 = v2.replace(/[^0-9.].*$/, '');
10+
v1 = v1.replace(/\.?[^0-9.].*$/, '');
11+
v2 = v2.replace(/\.?[^0-9.].*$/, '');
1212

1313
const v1Parts = v1.split('.').map(Number);
1414
const v2Parts = v2.split('.').map(Number);

0 commit comments

Comments
 (0)