1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Merge pull request #2888 from kazuhitoyokoi/dev-fixtraviserr

Fix regular expression for Node.js v8
This commit is contained in:
Nick O'Leary 2021-03-02 14:52:18 +00:00 committed by GitHub
commit 6c66ca8acf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,7 +31,7 @@ RED.palette.editor = (function() {
var eventTimers = {}; var eventTimers = {};
var activeFilter = ""; var activeFilter = "";
var semverre = /^(?<major>\d+)(\.(?<minor>\d+))?(\.(?<patch>\d+))?(-(?<pre>[0-9A-Za-z-]+))?(\.(?<build>[0-9A-Za-z-.]+))?$/; var semverre = /^(\d+)(\.(\d+))?(\.(\d+))?(-([0-9A-Za-z-]+))?(\.([0-9A-Za-z-.]+))?$/;
var NUMBERS_ONLY = /^\d+$/; var NUMBERS_ONLY = /^\d+$/;
function SemVerPart(part) { function SemVerPart(part) {
@ -61,8 +61,8 @@ RED.palette.editor = (function() {
}; };
function SemVer(ver) { function SemVer(ver) {
var groups = ver.match( semverre ).groups; var groups = ver.match( semverre );
this.parts = [ new SemVerPart( groups.major ), new SemVerPart( groups.minor ), new SemVerPart( groups.patch ), new SemVerPart( groups.pre ), new SemVerPart( groups.build ) ]; this.parts = [ new SemVerPart( groups[1] ), new SemVerPart( groups[3] ), new SemVerPart( groups[5] ), new SemVerPart( groups[7] ), new SemVerPart( groups[9] ) ];
} }
SemVer.prototype.compare = function(other) { SemVer.prototype.compare = function(other) {