function parseVersion(str) {
  // there is no ending "$", because of "rc"-like versions
  const versionReg = /^v?(\d+)\.(\d+)\.(\d+)/i;

  const match = versionReg.exec(str);

  if (match) {
    const parsed = [parseInt(match[1]), parseInt(match[2]), parseInt(match[3])];

    // fallback just in case some number did not parse
    if (Number.isNaN(parsed[0]) || Number.isNaN(parsed[1]) || Number.isNaN(parsed[2])) {
      console.log(`some version was matched but did not parse to int! "${str}"`);
      return undefined;
    }
    return parsed;
  }

  // special case, to not log a warning
  if (str === 'test') {
    return undefined;
  }

  console.log(`Failed to parse version! got: ${str}`);

  return undefined;
}
Parse a given semver version string to a number array
@param {string} str The string to parse
@returns number array or undefined