Skip to content

Commit

Permalink
Drop redundant dependency (#236)
Browse files Browse the repository at this point in the history
  • Loading branch information
fregante authored Aug 27, 2024
1 parent cb073f0 commit 0b962bc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
"latest-version": "^9.0.0",
"pupa": "^3.1.0",
"semver": "^7.6.3",
"semver-diff": "^4.0.0",
"xdg-basedir": "^5.1.0"
},
"devDependencies": {
Expand Down
7 changes: 4 additions & 3 deletions update-notifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import path from 'node:path';
import {format} from 'node:util';
import ConfigStore from 'configstore';
import chalk from 'chalk';
import semver from 'semver';
import semverDiff from 'semver-diff';
// Only import what we need for performance
import semverDiff from 'semver/functions/diff.js';
import semverGt from 'semver/functions/gt.js';
import latestVersion from 'latest-version';
import {isNpmOrYarn} from 'is-npm';
import isInstalledGlobally from 'is-installed-globally';
Expand Down Expand Up @@ -126,7 +127,7 @@ export default class UpdateNotifier {

notify(options) {
const suppressForNpm = !this._shouldNotifyInNpmScript && isNpmOrYarn;
if (!process.stdout.isTTY || suppressForNpm || !this.update || !semver.gt(this.update.latest, this.update.current)) {
if (!process.stdout.isTTY || suppressForNpm || !this.update || !semverGt(this.update.latest, this.update.current)) {
return this;
}

Expand Down

0 comments on commit 0b962bc

Please sign in to comment.