Better replace for complex semver comparisons
Ryan Blenis committed
Nov 24, 2019 at 16:36 UTC
25786df952a1f1ffa053d9c73393bce65ec0d4c7
1 file changed
+1
-1
pluginHandler.js
+1
-1
@@ -272,7 +272,7 @@ module.exports.pluginHandler = function (parent) {
272
// MeshCentral doesn't adhere to semantic versioning (due to the -<alpha_char> at the end of the version)
273
// Convert the letter to ASCII for a "true" version number comparison
274
var mcCurVer = parent.currentVer.replace(/-(.)$/, (m, p1) => { return p1.charCodeAt(0); });
275
- var piCompatVer = newconf.meshCentralCompat.replace(/-(.)$/, (m, p1) => { return p1.charCodeAt(0); });
275
+ var piCompatVer = newconf.meshCentralCompat.replace(/-(.)\b/g, (m, p1) => { return p1.charCodeAt(0); });
276
latestRet.push({
277
"id": curconf._id,
278
"installedVersion": curconf.version,