Code Monkey home page Code Monkey logo

semver-range-intersect's Issues

Insufficient version range normalization

intersect('>=1.2.3', '<=1.2.3') !== '1.2.3'
// return: '>=1.2.3 <=1.2.3'

intersect('>=1.2.3 <=1.2.3') !== '1.2.3'
// return: '>=1.2.3 <=1.2.3'

There is no difference in meaning between >=1.2.3 <=1.2.3 and 1.2.3.
However, the intersect version range is 1.2.3.
It is appropriate to return 1.2.3.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • ⬆️ Update dependency @types/semver to v6.2.3
  • ⬆️ Update dependency node to v10.24.1
  • ⬆️ Update dependency node to v11.15.0
  • ⬆️ Update dependency node to v12.22.12
  • ⬆️ Update dependency node to v8.17.0
  • ⬆️ Update dependency node to v9.11.2
  • ⬆️ Update dependency typescript to v5
  • 🔐 Create all rate-limited PRs at once 🔐

Edited/Blocked

These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

npm
package.json
  • @types/semver ^6.0.1
  • semver ^6.2.0
  • @typescript-eslint/eslint-plugin 2.0.0
  • @typescript-eslint/parser 2.0.0
  • ava 2.2.0
  • can-npm-publish 1.3.1
  • del-cli 2.0.0
  • eslint 6.3.0
  • eslint-config-prettier 6.1.0
  • eslint-config-standard 14.1.0
  • eslint-plugin-import 2.18.2
  • eslint-plugin-node 9.2.0
  • eslint-plugin-prettier 3.1.0
  • eslint-plugin-promise 4.2.1
  • eslint-plugin-simple-import-sort 4.0.0
  • eslint-plugin-standard 4.0.1
  • fast-deep-equal 2.0.1
  • git-branch-is 2.1.0
  • husky 3.0.1
  • is-git-status-clean 1.0.0
  • iter-tools 6.2.5
  • lint-staged 9.2.0
  • npm-run-all 4.1.5
  • package-version-git-tag 1.1.0
  • prettier 1.18.2
  • prettier-package-json 2.1.0
  • sort-package-json 1.22.1
  • ts-node 8.3.0
  • typescript 3.5.3
  • node >=8.3.0
travis
.travis.yml
  • node 12
  • node 12.0.0
  • node 11
  • node 11.0.0
  • node 10
  • node 10.0.0
  • node 9
  • node 9.0.0
  • node 8
  • node 8.3.0

  • Check this box to trigger a request for Renovate to run again on this repository

"*" version not processed correctly

intersect('* >=2')
// expected: >=2
// return: '' equals *

intersect('* || >=2')
// expected: *
// return: ">=2.0.0 "

intersect('*', '^1.0.2')
// expected: ^1.0.2
// return: '' equals *

A pattern separated by || with a range that does not match a range that does not match should return a range that matches

intersect('>2 <2') === null
// never match

intersect('*') === '*'
// any match

intersect('>=1.2.3', '>=2.3.4') === '>=2.3.4'
// intersect range

// -----

intersect('>2 <2 || *') !== '*'
// return: null

intersect('>=1.2.3 || >2 <2', '>=2.3.4') === '>=2.3.4'
// correct value

intersect('>=1.2.3', '>=2.3.4 || >2 <2') !== '>=2.3.4'
// return: '>=1.2.3'

intersect('>=1.2.3 || >2 <2', '>=2.3.4 || >2 <2') !== '>=2.3.4'
// return: null

Do not combine pre-release and any match

any match (eg *) does not match pre-release.

const semver = require('semver');

semver.satisfies('1.2.3-alpha', '* || >=1.2.3-0') === true

semver.satisfies('1.2.3-alpha', '*') === false

Therefore, it is wrong to convert '* ||> = 1.2.3-0' to '*'.

intersect('* || >=1.2.3-0') !== '* || >=1.2.3-0'
// return: '*'

Should return "*" instead of ""

semver.validRange() returns "*" for all matching version ranges.

const semver = require('semver')

semver.validRange('x.x.x') === '*'
semver.validRange('*') === '*'
semver.validRange('') === '*'

However, intersect() returns an empty string.

const { intersect } = require('semver-range-intersect')

intersect('x.x.x') === ''
intersect('*') === ''
intersect('') === ''

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.