mirror of
https://github.com/Lissy93/dashy.git
synced 2024-11-23 12:43:52 +03:00
⚡ Uses regex for parsing versions, as more efficient
This commit is contained in:
parent
fe57a266f1
commit
f16059d5e9
@ -5,7 +5,7 @@ const currentVersion = require('../package.json').version;
|
||||
const packageUrl = 'https://raw.githubusercontent.com/Lissy93/dashy/master/package.json';
|
||||
|
||||
const makeMsg = (latestVersion) => {
|
||||
const parse = (version) => parseInt(version.replaceAll('.', ''), 10);
|
||||
const parse = (version) => parseInt(version.replace(/\./g, ''), 10);
|
||||
const difference = parse(latestVersion) - parse(currentVersion);
|
||||
let msg = '';
|
||||
if (difference <= 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user