code: public static boolean npmVersionsMatch(String current, String next) {
          String left = current;
          String right = next;
          if (left == null || right == null) {
              return false;
          }
          if (left.equals(right) || "*".equals(left) || "*".equals(right)) {
              return true;
          }
          if (left.contains(" ")) { // we have a version string from package.json
              if (right.contains(" ")) { // we can't evaluate this ">=1.5.4 <2.0.0" vs "2 || 3"
                  return false;
              }
              if (!right.matches("^\\d.*$")) {
                  right = stripLeadingNonNumeric(right);
                  if (right == null) {
                      return false;
                  }
              }
              try {
                  final Semver v = new Semver(right, SemverType.NPM);
                  return v.satisfies(left);
              } catch (SemverException ex) {
                  LOGGER.trace("ignore", ex);
              }
          } else {
              if (!left.matches("^\\d.*$")) {
                  left = stripLeadingNonNumeric(left);
                  if (left == null || left.isEmpty()) {
                      return false;
                  }
              }
              try {
                  Semver v = new Semver(left, SemverType.NPM);
                  if (!right.isEmpty() && v.satisfies(right)) {
                      return true;
                  }
                  if (!right.contains(" ")) {
                      left = current;
                      right = stripLeadingNonNumeric(right);
                      if (right != null) {
                          v = new Semver(right, SemverType.NPM);
                          return v.satisfies(left);
                      }
                  }
              } catch (SemverException ex) {
                  LOGGER.trace("ignore", ex);
              } catch (NullPointerException ex) {
                  LOGGER.error("SemVer comparison error: left:\"{}\", right:\"{}\"", left, right);
                  LOGGER.debug("SemVer comparison resulted in NPE", ex);
              }
          }
          return false;
      }
docs: Determine if the dependency version is equal in the given dependencies.
  This method attempts to evaluate version range checks.
  
  @param current a dependency version to compare
  @param next a dependency version to compare
  @return true if the version is equal in both dependencies; otherwise
  false