How to use semver-diff - 5 common examples

To help you get started, we’ve selected a few semver-diff examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rekit / rekit / packages / rekit-studio / src / features / config / selectors / depsSelector.js View on Github external
.map(name => {
      const dep = allDeps[name];
      return {
        name,
        requiredVersion: dep.requiredVersion,
        installedVersion: dep.installedVersion,
        latestVersion: dep.latestVersion,
        status: (dep.latestVersion && dep.installedVersion !== '--')
          ? semverDiff(dep.installedVersion, dep.latestVersion) + '' // eslint-disable-line
          : '',
      };
    })
    .sort((a, b) => a.name.localeCompare(b.name));
github faceit-enhancer / faceit-enhancer / src / background / index.js View on Github external
browser.runtime.onInstalled.addListener(async ({ reason, previousVersion }) => {
  if (reason === 'update') {
    const { installType } = await browser.management.getSelf()

    if (installType === 'development') {
      return
    }

    const { version } = browser.runtime.getManifest()

    const versionDiffType = semverDiff(previousVersion, version)
    if (versionDiffType === null || versionDiffType === 'patch') {
      return
    }

    const changelogUrl = changelogs[version]

    if (changelogUrl) {
      const {
        updateNotificationType,
        updateNotifications
      } = await storage.getAll()

      switch (updateNotificationType) {
        // Tab
        case UPDATE_NOTIFICATION_TYPES[0]: {
          browser.tabs.create({
github vtex / toolbelt / src / update.js View on Github external
function updateCallback (err, update) {
  if (err) {
    throw Error(err)
  }

  if (!semverDiff(update.current, update.latest)) {
    return
  }

  this.update = update
  this.notify()
}
github reportportal / service-ui / app / src / pages / outside / loginPage / pageBlocks / serviceVersionsBlock / serviceVersionsBlockWithData.jsx View on Github external
const serviceValue = appInfo[serviceKey];
      if (!(serviceValue && serviceValue.build)) return false;

      const currentVersion = serviceValue.build.version;

      if (!currentVersion) return false;

      const latestVersion = latestServiceVersions[serviceValue.build.repo];

      services[serviceKey] = {
        name: serviceValue.build.name,
        version: serviceValue.build.version,
        newVersion: latestVersion || null,
        repo: serviceValue.build.repo || null,
        isDeprecated:
          serviceValue.build.repo && latestVersion && semverDiff(currentVersion, latestVersion),
      };

      return true;
    });
github strvcom / dep-manager-web / src / components / Widgets / LibraryActualityWidget.tsx View on Github external
const outDatedDependents = dependents.reduce((acc1, dependent) => {
        const dependentVersion = semverRegex().exec(dependent.version)![0]
        const diff = semverDiff(dependentVersion, libraryVersion)
        return diff === 'major' ? acc1 + 1 : acc1
      }, 0)
      return {

semver-diff

Get the diff type of two semver versions: 0.0.1 0.0.2 → patch

MIT
Latest version published 3 years ago

Package Health Score

70 / 100
Full package analysis

Popular semver-diff functions