index.js 287 B

12345678910111213
  1. 'use strict';
  2. const semver = require('semver');
  3. module.exports = (versionA, versionB) => {
  4. versionA = semver.parse(versionA);
  5. versionB = semver.parse(versionB);
  6. if (semver.compareBuild(versionA, versionB) >= 0) {
  7. return;
  8. }
  9. return semver.diff(versionA, versionB) || 'build';
  10. };