scripts/build-changelog.js
function parseVersion(v) {
  const [
    , // Full match of no interest.
    major = null,
    sub = null,
    minor = null,
  ] = /^v?(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-.*)?$/.exec(v);
  if (major === null || sub === null || minor === null) {
    const err = new Error(`Invalid version string (${v})!`);
    logger.error(err);
    throw err;
  }

  return {
    major,
    sub,
    minor,
  };
}
function parseVersion(v) {
  const [
    , // Full match of no interest.
    major = null,
    sub = null,
    minor = null,
  ] = /^v?(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-.*)?$/.exec(v);
  if (major === null || sub === null || minor === null) {
    const err = new Error(`Invalid version string (${v})!`);
    logger.error(err);
    throw err;
  }

  return {
    major,
    sub,
    minor,
  };
}
function parseVersion ( v ) { const [ , // Full match of no interest. major = null , sub = null , minor = null , ] = / ^v?(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-.*)?$ / . exec ( v ) ; if ( major === null || sub === null || minor === null ) { const err = new Error ( ` ${ v } ` ) ; logger . error ( err ) ; throw err ; } return { major , sub , minor , } ; }
Parses a version into its components without prerelease information.
@param {string} v The version to be parsed
@return {{sub: number, major: number, minor: number}}
Parses a version into its components without prerelease information .