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

Fix regular expression for Node.js v8

This commit is contained in:
Kazuhito Yokoi 2021-03-02 13:13:23 +00:00
parent 0566a2d9b1
commit d58a091bb7

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) {