node-datachannel 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/build-linux.yml +2 -0
- package/CMakeLists.txt +2 -2
- package/lib/datachannel-stream.js +86 -0
- package/lib/index.d.ts +10 -0
- package/lib/index.js +3 -1
- package/node_modules/decompress-response/index.d.ts +14 -21
- package/node_modules/decompress-response/index.js +34 -16
- package/node_modules/decompress-response/license +1 -1
- package/node_modules/decompress-response/package.json +23 -17
- package/node_modules/decompress-response/readme.md +2 -6
- package/node_modules/detect-libc/README.md +124 -42
- package/node_modules/detect-libc/index.d.ts +11 -0
- package/node_modules/detect-libc/lib/detect-libc.js +166 -80
- package/node_modules/detect-libc/lib/process.js +16 -0
- package/node_modules/detect-libc/package.json +20 -20
- package/node_modules/{semver → lru-cache}/LICENSE +0 -0
- package/node_modules/lru-cache/README.md +166 -0
- package/node_modules/lru-cache/index.js +334 -0
- package/node_modules/lru-cache/node_modules/yallist/LICENSE +15 -0
- package/node_modules/lru-cache/node_modules/yallist/README.md +204 -0
- package/node_modules/lru-cache/node_modules/yallist/iterator.js +8 -0
- package/node_modules/lru-cache/node_modules/yallist/package.json +65 -0
- package/node_modules/lru-cache/node_modules/yallist/yallist.js +426 -0
- package/node_modules/lru-cache/package.json +74 -0
- package/node_modules/mimic-response/index.d.ts +2 -2
- package/node_modules/mimic-response/index.js +41 -2
- package/node_modules/mimic-response/package.json +17 -17
- package/node_modules/mimic-response/readme.md +22 -1
- package/node_modules/node-abi/.circleci/config.yml +63 -0
- package/node_modules/node-abi/.releaserc.json +9 -0
- package/node_modules/node-abi/abi_registry.json +45 -3
- package/node_modules/node-abi/index.js +5 -2
- package/node_modules/node-abi/node_modules/semver/CHANGELOG.md +111 -0
- package/node_modules/node-abi/node_modules/semver/LICENSE +15 -0
- package/node_modules/{semver → node-abi/node_modules/semver}/README.md +180 -26
- package/node_modules/node-abi/node_modules/semver/bin/semver.js +173 -0
- package/node_modules/node-abi/node_modules/semver/classes/comparator.js +135 -0
- package/node_modules/node-abi/node_modules/semver/classes/index.js +5 -0
- package/node_modules/node-abi/node_modules/semver/classes/range.js +510 -0
- package/node_modules/node-abi/node_modules/semver/classes/semver.js +287 -0
- package/node_modules/node-abi/node_modules/semver/functions/clean.js +6 -0
- package/node_modules/node-abi/node_modules/semver/functions/cmp.js +48 -0
- package/node_modules/node-abi/node_modules/semver/functions/coerce.js +51 -0
- package/node_modules/node-abi/node_modules/semver/functions/compare-build.js +7 -0
- package/node_modules/node-abi/node_modules/semver/functions/compare-loose.js +3 -0
- package/node_modules/node-abi/node_modules/semver/functions/compare.js +5 -0
- package/node_modules/node-abi/node_modules/semver/functions/diff.js +23 -0
- package/node_modules/node-abi/node_modules/semver/functions/eq.js +3 -0
- package/node_modules/node-abi/node_modules/semver/functions/gt.js +3 -0
- package/node_modules/node-abi/node_modules/semver/functions/gte.js +3 -0
- package/node_modules/node-abi/node_modules/semver/functions/inc.js +15 -0
- package/node_modules/node-abi/node_modules/semver/functions/lt.js +3 -0
- package/node_modules/node-abi/node_modules/semver/functions/lte.js +3 -0
- package/node_modules/node-abi/node_modules/semver/functions/major.js +3 -0
- package/node_modules/node-abi/node_modules/semver/functions/minor.js +3 -0
- package/node_modules/node-abi/node_modules/semver/functions/neq.js +3 -0
- package/node_modules/node-abi/node_modules/semver/functions/parse.js +33 -0
- package/node_modules/node-abi/node_modules/semver/functions/patch.js +3 -0
- package/node_modules/node-abi/node_modules/semver/functions/prerelease.js +6 -0
- package/node_modules/node-abi/node_modules/semver/functions/rcompare.js +3 -0
- package/node_modules/node-abi/node_modules/semver/functions/rsort.js +3 -0
- package/node_modules/node-abi/node_modules/semver/functions/satisfies.js +10 -0
- package/node_modules/node-abi/node_modules/semver/functions/sort.js +3 -0
- package/node_modules/node-abi/node_modules/semver/functions/valid.js +6 -0
- package/node_modules/node-abi/node_modules/semver/index.js +48 -0
- package/node_modules/node-abi/node_modules/semver/internal/constants.js +17 -0
- package/node_modules/node-abi/node_modules/semver/internal/debug.js +9 -0
- package/node_modules/node-abi/node_modules/semver/internal/identifiers.js +23 -0
- package/node_modules/node-abi/node_modules/semver/internal/parse-options.js +11 -0
- package/node_modules/node-abi/node_modules/semver/internal/re.js +182 -0
- package/node_modules/{semver → node-abi/node_modules/semver}/package.json +32 -23
- package/node_modules/node-abi/node_modules/semver/preload.js +2 -0
- package/node_modules/{semver → node-abi/node_modules/semver}/range.bnf +0 -0
- package/node_modules/node-abi/node_modules/semver/ranges/gtr.js +4 -0
- package/node_modules/node-abi/node_modules/semver/ranges/intersects.js +7 -0
- package/node_modules/node-abi/node_modules/semver/ranges/ltr.js +4 -0
- package/node_modules/node-abi/node_modules/semver/ranges/max-satisfying.js +25 -0
- package/node_modules/node-abi/node_modules/semver/ranges/min-satisfying.js +24 -0
- package/node_modules/node-abi/node_modules/semver/ranges/min-version.js +60 -0
- package/node_modules/node-abi/node_modules/semver/ranges/outside.js +80 -0
- package/node_modules/node-abi/node_modules/semver/ranges/simplify.js +44 -0
- package/node_modules/node-abi/node_modules/semver/ranges/subset.js +222 -0
- package/node_modules/node-abi/node_modules/semver/ranges/to-comparators.js +8 -0
- package/node_modules/node-abi/node_modules/semver/ranges/valid.js +11 -0
- package/node_modules/node-abi/package.json +20 -17
- package/node_modules/node-abi/test/index.js +7 -15
- package/node_modules/prebuild-install/CHANGELOG.md +24 -7
- package/node_modules/prebuild-install/README.md +24 -4
- package/node_modules/prebuild-install/asset.js +10 -10
- package/node_modules/prebuild-install/bin.js +13 -13
- package/node_modules/prebuild-install/download.js +22 -22
- package/node_modules/prebuild-install/log.js +4 -4
- package/node_modules/prebuild-install/package.json +18 -19
- package/node_modules/prebuild-install/proxy.js +10 -10
- package/node_modules/prebuild-install/rc.js +12 -12
- package/node_modules/prebuild-install/util.js +14 -14
- package/node_modules/simple-get/.github/dependabot.yml +15 -0
- package/node_modules/simple-get/.github/workflows/ci.yml +23 -0
- package/node_modules/simple-get/README.md +17 -3
- package/node_modules/simple-get/index.js +9 -0
- package/node_modules/simple-get/package.json +27 -13
- package/package.json +6 -5
- package/test/test.js +45 -0
- package/node_modules/detect-libc/.npmignore +0 -7
- package/node_modules/detect-libc/bin/detect-libc.js +0 -18
- package/node_modules/node-abi/.travis.yml +0 -17
- package/node_modules/semver/CHANGELOG.md +0 -39
- package/node_modules/semver/bin/semver +0 -160
- package/node_modules/semver/semver.js +0 -1483
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
step-restore-cache: &step-restore-cache
|
|
2
|
+
restore_cache:
|
|
3
|
+
keys:
|
|
4
|
+
- v1-dependencies-{{ arch }}-{{ checksum "yarn.lock" }}
|
|
5
|
+
- v1-dependencies-{{ arch }}
|
|
6
|
+
|
|
7
|
+
steps-test: &steps-test
|
|
8
|
+
steps:
|
|
9
|
+
- checkout
|
|
10
|
+
- *step-restore-cache
|
|
11
|
+
- run: yarn --frozen-lockfile
|
|
12
|
+
- save_cache:
|
|
13
|
+
paths:
|
|
14
|
+
- node_modules
|
|
15
|
+
key: v1-dependencies-{{ arch }}-{{ checksum "yarn.lock" }}
|
|
16
|
+
- run: yarn test
|
|
17
|
+
|
|
18
|
+
version: 2.1
|
|
19
|
+
jobs:
|
|
20
|
+
test-linux-10:
|
|
21
|
+
docker:
|
|
22
|
+
- image: circleci/node:10
|
|
23
|
+
<<: *steps-test
|
|
24
|
+
test-linux-12:
|
|
25
|
+
docker:
|
|
26
|
+
- image: circleci/node:12
|
|
27
|
+
<<: *steps-test
|
|
28
|
+
test-linux-14:
|
|
29
|
+
docker:
|
|
30
|
+
- image: circleci/node:14
|
|
31
|
+
<<: *steps-test
|
|
32
|
+
test-linux-16:
|
|
33
|
+
docker:
|
|
34
|
+
- image: circleci/node:16
|
|
35
|
+
<<: *steps-test
|
|
36
|
+
|
|
37
|
+
release:
|
|
38
|
+
docker:
|
|
39
|
+
- image: circleci/node:14.15
|
|
40
|
+
steps:
|
|
41
|
+
- checkout
|
|
42
|
+
- *step-restore-cache
|
|
43
|
+
- run: yarn --frozen-lockfile
|
|
44
|
+
- run: npx semantic-release@17.4.5
|
|
45
|
+
workflows:
|
|
46
|
+
version: 2
|
|
47
|
+
test_and_release:
|
|
48
|
+
# Run test jobs first, release only when all the test jobs are successful
|
|
49
|
+
jobs:
|
|
50
|
+
- test-linux-10
|
|
51
|
+
- test-linux-12
|
|
52
|
+
- test-linux-14
|
|
53
|
+
- test-linux-16
|
|
54
|
+
- release:
|
|
55
|
+
requires:
|
|
56
|
+
- test-linux-10
|
|
57
|
+
- test-linux-12
|
|
58
|
+
- test-linux-14
|
|
59
|
+
- test-linux-16
|
|
60
|
+
filters:
|
|
61
|
+
branches:
|
|
62
|
+
only:
|
|
63
|
+
- main
|
|
@@ -50,6 +50,13 @@
|
|
|
50
50
|
"future": false,
|
|
51
51
|
"abi": "93"
|
|
52
52
|
},
|
|
53
|
+
{
|
|
54
|
+
"runtime": "node",
|
|
55
|
+
"target": "17.0.0",
|
|
56
|
+
"lts": false,
|
|
57
|
+
"future": false,
|
|
58
|
+
"abi": "102"
|
|
59
|
+
},
|
|
53
60
|
{
|
|
54
61
|
"abi": "70",
|
|
55
62
|
"future": false,
|
|
@@ -125,20 +132,55 @@
|
|
|
125
132
|
"future": false,
|
|
126
133
|
"lts": false,
|
|
127
134
|
"runtime": "electron",
|
|
128
|
-
"target": "
|
|
135
|
+
"target": "13.0.0-beta.2"
|
|
129
136
|
},
|
|
130
137
|
{
|
|
131
138
|
"abi": "89",
|
|
132
139
|
"future": false,
|
|
133
140
|
"lts": false,
|
|
134
141
|
"runtime": "electron",
|
|
135
|
-
"target": "
|
|
142
|
+
"target": "15.0.0-alpha.1"
|
|
136
143
|
},
|
|
137
144
|
{
|
|
138
145
|
"abi": "89",
|
|
146
|
+
"future": false,
|
|
147
|
+
"lts": false,
|
|
148
|
+
"runtime": "electron",
|
|
149
|
+
"target": "14.0.0-beta.1"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"abi": "97",
|
|
153
|
+
"future": false,
|
|
154
|
+
"lts": false,
|
|
155
|
+
"runtime": "electron",
|
|
156
|
+
"target": "14.0.2"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"abi": "98",
|
|
160
|
+
"future": false,
|
|
161
|
+
"lts": false,
|
|
162
|
+
"runtime": "electron",
|
|
163
|
+
"target": "15.0.0-beta.7"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"abi": "99",
|
|
167
|
+
"future": false,
|
|
168
|
+
"lts": false,
|
|
169
|
+
"runtime": "electron",
|
|
170
|
+
"target": "16.0.0-alpha.1"
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"abi": "101",
|
|
174
|
+
"future": false,
|
|
175
|
+
"lts": false,
|
|
176
|
+
"runtime": "electron",
|
|
177
|
+
"target": "17.0.0-alpha.1"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"abi": "103",
|
|
139
181
|
"future": true,
|
|
140
182
|
"lts": false,
|
|
141
183
|
"runtime": "electron",
|
|
142
|
-
"target": "
|
|
184
|
+
"target": "18.0.0-alpha.1"
|
|
143
185
|
}
|
|
144
186
|
]
|
|
@@ -24,12 +24,15 @@ function getAbi (target, runtime) {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
var abi
|
|
27
|
+
var lastTarget
|
|
27
28
|
|
|
28
29
|
for (var i = 0; i < allTargets.length; i++) {
|
|
29
30
|
var t = allTargets[i]
|
|
30
31
|
if (t.runtime !== runtime) continue
|
|
31
|
-
if (semver.lte(t.target, target)
|
|
32
|
-
|
|
32
|
+
if (semver.lte(t.target, target) && (!lastTarget || semver.gte(t.target, lastTarget))) {
|
|
33
|
+
abi = t.abi
|
|
34
|
+
lastTarget = t.target
|
|
35
|
+
}
|
|
33
36
|
}
|
|
34
37
|
|
|
35
38
|
if (abi && semver.lt(target, getNextTarget(runtime))) return abi
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# changes log
|
|
2
|
+
|
|
3
|
+
## 7.3.0
|
|
4
|
+
|
|
5
|
+
* Add `subset(r1, r2)` method to determine if `r1` range is entirely
|
|
6
|
+
contained by `r2` range.
|
|
7
|
+
|
|
8
|
+
## 7.2.3
|
|
9
|
+
|
|
10
|
+
* Fix handling of `includePrelease` mode where version ranges like `1.0.0 -
|
|
11
|
+
2.0.0` would include `3.0.0-pre` and not `1.0.0-pre`.
|
|
12
|
+
|
|
13
|
+
## 7.2.2
|
|
14
|
+
|
|
15
|
+
* Fix bug where `2.0.0-pre` would be included in `^1.0.0` if
|
|
16
|
+
`includePrerelease` was set to true.
|
|
17
|
+
|
|
18
|
+
## 7.2.0
|
|
19
|
+
|
|
20
|
+
* Add `simplifyRange` method to attempt to generate a more human-readable
|
|
21
|
+
range expression that is equivalent to a supplied range, for a given set
|
|
22
|
+
of versions.
|
|
23
|
+
|
|
24
|
+
## 7.1.2
|
|
25
|
+
|
|
26
|
+
* Remove fancy lazy-loading logic, as it was causing problems for webpack
|
|
27
|
+
users.
|
|
28
|
+
|
|
29
|
+
## 7.1.0
|
|
30
|
+
|
|
31
|
+
* Add `require('semver/preload')` to load the entire module without using
|
|
32
|
+
lazy getter methods.
|
|
33
|
+
|
|
34
|
+
## 7.0.0
|
|
35
|
+
|
|
36
|
+
* Refactor module into separate files for better tree-shaking
|
|
37
|
+
* Drop support for very old node versions, use const/let, `=>` functions,
|
|
38
|
+
and classes.
|
|
39
|
+
|
|
40
|
+
## 6.3.0
|
|
41
|
+
|
|
42
|
+
* Expose the token enum on the exports
|
|
43
|
+
|
|
44
|
+
## 6.2.0
|
|
45
|
+
|
|
46
|
+
* Coerce numbers to strings when passed to semver.coerce()
|
|
47
|
+
* Add `rtl` option to coerce from right to left
|
|
48
|
+
|
|
49
|
+
## 6.1.3
|
|
50
|
+
|
|
51
|
+
* Handle X-ranges properly in includePrerelease mode
|
|
52
|
+
|
|
53
|
+
## 6.1.2
|
|
54
|
+
|
|
55
|
+
* Do not throw when testing invalid version strings
|
|
56
|
+
|
|
57
|
+
## 6.1.1
|
|
58
|
+
|
|
59
|
+
* Add options support for semver.coerce()
|
|
60
|
+
* Handle undefined version passed to Range.test
|
|
61
|
+
|
|
62
|
+
## 6.1.0
|
|
63
|
+
|
|
64
|
+
* Add semver.compareBuild function
|
|
65
|
+
* Support `*` in semver.intersects
|
|
66
|
+
|
|
67
|
+
## 6.0
|
|
68
|
+
|
|
69
|
+
* Fix `intersects` logic.
|
|
70
|
+
|
|
71
|
+
This is technically a bug fix, but since it is also a change to behavior
|
|
72
|
+
that may require users updating their code, it is marked as a major
|
|
73
|
+
version increment.
|
|
74
|
+
|
|
75
|
+
## 5.7
|
|
76
|
+
|
|
77
|
+
* Add `minVersion` method
|
|
78
|
+
|
|
79
|
+
## 5.6
|
|
80
|
+
|
|
81
|
+
* Move boolean `loose` param to an options object, with
|
|
82
|
+
backwards-compatibility protection.
|
|
83
|
+
* Add ability to opt out of special prerelease version handling with
|
|
84
|
+
the `includePrerelease` option flag.
|
|
85
|
+
|
|
86
|
+
## 5.5
|
|
87
|
+
|
|
88
|
+
* Add version coercion capabilities
|
|
89
|
+
|
|
90
|
+
## 5.4
|
|
91
|
+
|
|
92
|
+
* Add intersection checking
|
|
93
|
+
|
|
94
|
+
## 5.3
|
|
95
|
+
|
|
96
|
+
* Add `minSatisfying` method
|
|
97
|
+
|
|
98
|
+
## 5.2
|
|
99
|
+
|
|
100
|
+
* Add `prerelease(v)` that returns prerelease components
|
|
101
|
+
|
|
102
|
+
## 5.1
|
|
103
|
+
|
|
104
|
+
* Add Backus-Naur for ranges
|
|
105
|
+
* Remove excessively cute inspection methods
|
|
106
|
+
|
|
107
|
+
## 5.0
|
|
108
|
+
|
|
109
|
+
* Remove AMD/Browserified build artifacts
|
|
110
|
+
* Fix ltr and gtr when using the `*` range
|
|
111
|
+
* Fix for range `*` with a prerelease identifier
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
The ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Isaac Z. Schlueter and Contributors
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
10
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
11
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
12
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
13
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
14
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
15
|
+
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
@@ -4,7 +4,7 @@ semver(1) -- The semantic versioner for npm
|
|
|
4
4
|
## Install
|
|
5
5
|
|
|
6
6
|
```bash
|
|
7
|
-
npm install
|
|
7
|
+
npm install semver
|
|
8
8
|
````
|
|
9
9
|
|
|
10
10
|
## Usage
|
|
@@ -25,6 +25,63 @@ semver.valid(semver.coerce('v2')) // '2.0.0'
|
|
|
25
25
|
semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7'
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
+
You can also just load the module for the function that you care about, if
|
|
29
|
+
you'd like to minimize your footprint.
|
|
30
|
+
|
|
31
|
+
```js
|
|
32
|
+
// load the whole API at once in a single object
|
|
33
|
+
const semver = require('semver')
|
|
34
|
+
|
|
35
|
+
// or just load the bits you need
|
|
36
|
+
// all of them listed here, just pick and choose what you want
|
|
37
|
+
|
|
38
|
+
// classes
|
|
39
|
+
const SemVer = require('semver/classes/semver')
|
|
40
|
+
const Comparator = require('semver/classes/comparator')
|
|
41
|
+
const Range = require('semver/classes/range')
|
|
42
|
+
|
|
43
|
+
// functions for working with versions
|
|
44
|
+
const semverParse = require('semver/functions/parse')
|
|
45
|
+
const semverValid = require('semver/functions/valid')
|
|
46
|
+
const semverClean = require('semver/functions/clean')
|
|
47
|
+
const semverInc = require('semver/functions/inc')
|
|
48
|
+
const semverDiff = require('semver/functions/diff')
|
|
49
|
+
const semverMajor = require('semver/functions/major')
|
|
50
|
+
const semverMinor = require('semver/functions/minor')
|
|
51
|
+
const semverPatch = require('semver/functions/patch')
|
|
52
|
+
const semverPrerelease = require('semver/functions/prerelease')
|
|
53
|
+
const semverCompare = require('semver/functions/compare')
|
|
54
|
+
const semverRcompare = require('semver/functions/rcompare')
|
|
55
|
+
const semverCompareLoose = require('semver/functions/compare-loose')
|
|
56
|
+
const semverCompareBuild = require('semver/functions/compare-build')
|
|
57
|
+
const semverSort = require('semver/functions/sort')
|
|
58
|
+
const semverRsort = require('semver/functions/rsort')
|
|
59
|
+
|
|
60
|
+
// low-level comparators between versions
|
|
61
|
+
const semverGt = require('semver/functions/gt')
|
|
62
|
+
const semverLt = require('semver/functions/lt')
|
|
63
|
+
const semverEq = require('semver/functions/eq')
|
|
64
|
+
const semverNeq = require('semver/functions/neq')
|
|
65
|
+
const semverGte = require('semver/functions/gte')
|
|
66
|
+
const semverLte = require('semver/functions/lte')
|
|
67
|
+
const semverCmp = require('semver/functions/cmp')
|
|
68
|
+
const semverCoerce = require('semver/functions/coerce')
|
|
69
|
+
|
|
70
|
+
// working with ranges
|
|
71
|
+
const semverSatisfies = require('semver/functions/satisfies')
|
|
72
|
+
const semverMaxSatisfying = require('semver/ranges/max-satisfying')
|
|
73
|
+
const semverMinSatisfying = require('semver/ranges/min-satisfying')
|
|
74
|
+
const semverToComparators = require('semver/ranges/to-comparators')
|
|
75
|
+
const semverMinVersion = require('semver/ranges/min-version')
|
|
76
|
+
const semverValidRange = require('semver/ranges/valid')
|
|
77
|
+
const semverOutside = require('semver/ranges/outside')
|
|
78
|
+
const semverGtr = require('semver/ranges/gtr')
|
|
79
|
+
const semverLtr = require('semver/ranges/ltr')
|
|
80
|
+
const semverIntersects = require('semver/ranges/intersects')
|
|
81
|
+
const simplifyRange = require('semver/ranges/simplify')
|
|
82
|
+
const rangeSubset = require('semver/ranges/subset')
|
|
83
|
+
```
|
|
84
|
+
|
|
28
85
|
As a command-line utility:
|
|
29
86
|
|
|
30
87
|
```
|
|
@@ -60,6 +117,12 @@ Options:
|
|
|
60
117
|
Coerce a string into SemVer if possible
|
|
61
118
|
(does not imply --loose)
|
|
62
119
|
|
|
120
|
+
--rtl
|
|
121
|
+
Coerce version strings right to left
|
|
122
|
+
|
|
123
|
+
--ltr
|
|
124
|
+
Coerce version strings left to right (default)
|
|
125
|
+
|
|
63
126
|
Program exits successfully if any valid version satisfies
|
|
64
127
|
all supplied ranges, and prints all satisfying versions.
|
|
65
128
|
|
|
@@ -193,8 +256,8 @@ inclusive range, then all versions that start with the supplied parts
|
|
|
193
256
|
of the tuple are accepted, but nothing that would be greater than the
|
|
194
257
|
provided tuple parts.
|
|
195
258
|
|
|
196
|
-
* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0`
|
|
197
|
-
* `1.2.3 - 2` := `>=1.2.3 <3.0.0`
|
|
259
|
+
* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0-0`
|
|
260
|
+
* `1.2.3 - 2` := `>=1.2.3 <3.0.0-0`
|
|
198
261
|
|
|
199
262
|
#### X-Ranges `1.2.x` `1.X` `1.2.*` `*`
|
|
200
263
|
|
|
@@ -202,28 +265,28 @@ Any of `X`, `x`, or `*` may be used to "stand in" for one of the
|
|
|
202
265
|
numeric values in the `[major, minor, patch]` tuple.
|
|
203
266
|
|
|
204
267
|
* `*` := `>=0.0.0` (Any version satisfies)
|
|
205
|
-
* `1.x` := `>=1.0.0 <2.0.0` (Matching major version)
|
|
206
|
-
* `1.2.x` := `>=1.2.0 <1.3.0` (Matching major and minor versions)
|
|
268
|
+
* `1.x` := `>=1.0.0 <2.0.0-0` (Matching major version)
|
|
269
|
+
* `1.2.x` := `>=1.2.0 <1.3.0-0` (Matching major and minor versions)
|
|
207
270
|
|
|
208
271
|
A partial version range is treated as an X-Range, so the special
|
|
209
272
|
character is in fact optional.
|
|
210
273
|
|
|
211
274
|
* `""` (empty string) := `*` := `>=0.0.0`
|
|
212
|
-
* `1` := `1.x.x` := `>=1.0.0 <2.0.0`
|
|
213
|
-
* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0`
|
|
275
|
+
* `1` := `1.x.x` := `>=1.0.0 <2.0.0-0`
|
|
276
|
+
* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0-0`
|
|
214
277
|
|
|
215
278
|
#### Tilde Ranges `~1.2.3` `~1.2` `~1`
|
|
216
279
|
|
|
217
280
|
Allows patch-level changes if a minor version is specified on the
|
|
218
281
|
comparator. Allows minor-level changes if not.
|
|
219
282
|
|
|
220
|
-
* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0`
|
|
221
|
-
* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0` (Same as `1.2.x`)
|
|
222
|
-
* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0` (Same as `1.x`)
|
|
223
|
-
* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0`
|
|
224
|
-
* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0` (Same as `0.2.x`)
|
|
225
|
-
* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0` (Same as `0.x`)
|
|
226
|
-
* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0` Note that prereleases in
|
|
283
|
+
* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0-0`
|
|
284
|
+
* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0-0` (Same as `1.2.x`)
|
|
285
|
+
* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0-0` (Same as `1.x`)
|
|
286
|
+
* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0-0`
|
|
287
|
+
* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0-0` (Same as `0.2.x`)
|
|
288
|
+
* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0-0` (Same as `0.x`)
|
|
289
|
+
* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0-0` Note that prereleases in
|
|
227
290
|
the `1.2.3` version will be allowed, if they are greater than or
|
|
228
291
|
equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
|
|
229
292
|
`1.2.4-beta.2` would not, because it is a prerelease of a
|
|
@@ -231,7 +294,7 @@ comparator. Allows minor-level changes if not.
|
|
|
231
294
|
|
|
232
295
|
#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4`
|
|
233
296
|
|
|
234
|
-
Allows changes that do not modify the left-most non-zero
|
|
297
|
+
Allows changes that do not modify the left-most non-zero element in the
|
|
235
298
|
`[major, minor, patch]` tuple. In other words, this allows patch and
|
|
236
299
|
minor updates for versions `1.0.0` and above, patch updates for
|
|
237
300
|
versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`.
|
|
@@ -245,15 +308,15 @@ However, it presumes that there will *not* be breaking changes between
|
|
|
245
308
|
`0.2.4` and `0.2.5`. It allows for changes that are presumed to be
|
|
246
309
|
additive (but non-breaking), according to commonly observed practices.
|
|
247
310
|
|
|
248
|
-
* `^1.2.3` := `>=1.2.3 <2.0.0`
|
|
249
|
-
* `^0.2.3` := `>=0.2.3 <0.3.0`
|
|
250
|
-
* `^0.0.3` := `>=0.0.3 <0.0.4`
|
|
251
|
-
* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0` Note that prereleases in
|
|
311
|
+
* `^1.2.3` := `>=1.2.3 <2.0.0-0`
|
|
312
|
+
* `^0.2.3` := `>=0.2.3 <0.3.0-0`
|
|
313
|
+
* `^0.0.3` := `>=0.0.3 <0.0.4-0`
|
|
314
|
+
* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0-0` Note that prereleases in
|
|
252
315
|
the `1.2.3` version will be allowed, if they are greater than or
|
|
253
316
|
equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
|
|
254
317
|
`1.2.4-beta.2` would not, because it is a prerelease of a
|
|
255
318
|
different `[major, minor, patch]` tuple.
|
|
256
|
-
* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4` Note that prereleases in the
|
|
319
|
+
* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4-0` Note that prereleases in the
|
|
257
320
|
`0.0.3` version *only* will be allowed, if they are greater than or
|
|
258
321
|
equal to `beta`. So, `0.0.3-pr.2` would be allowed.
|
|
259
322
|
|
|
@@ -261,16 +324,16 @@ When parsing caret ranges, a missing `patch` value desugars to the
|
|
|
261
324
|
number `0`, but will allow flexibility within that value, even if the
|
|
262
325
|
major and minor versions are both `0`.
|
|
263
326
|
|
|
264
|
-
* `^1.2.x` := `>=1.2.0 <2.0.0`
|
|
265
|
-
* `^0.0.x` := `>=0.0.0 <0.1.0`
|
|
266
|
-
* `^0.0` := `>=0.0.0 <0.1.0`
|
|
327
|
+
* `^1.2.x` := `>=1.2.0 <2.0.0-0`
|
|
328
|
+
* `^0.0.x` := `>=0.0.0 <0.1.0-0`
|
|
329
|
+
* `^0.0` := `>=0.0.0 <0.1.0-0`
|
|
267
330
|
|
|
268
331
|
A missing `minor` and `patch` values will desugar to zero, but also
|
|
269
332
|
allow flexibility within those values, even if the major version is
|
|
270
333
|
zero.
|
|
271
334
|
|
|
272
|
-
* `^1.x` := `>=1.0.0 <2.0.0`
|
|
273
|
-
* `^0.x` := `>=0.0.0 <1.0.0`
|
|
335
|
+
* `^1.x` := `>=1.0.0 <2.0.0-0`
|
|
336
|
+
* `^0.x` := `>=0.0.0 <1.0.0-0`
|
|
274
337
|
|
|
275
338
|
### Range Grammar
|
|
276
339
|
|
|
@@ -354,6 +417,9 @@ strings that they parse.
|
|
|
354
417
|
`v2` is greater. Sorts in ascending order if passed to `Array.sort()`.
|
|
355
418
|
* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions
|
|
356
419
|
in descending order when passed to `Array.sort()`.
|
|
420
|
+
* `compareBuild(v1, v2)`: The same as `compare` but considers `build` when two versions
|
|
421
|
+
are equal. Sorts in ascending order if passed to `Array.sort()`.
|
|
422
|
+
`v2` is greater. Sorts in ascending order if passed to `Array.sort()`.
|
|
357
423
|
* `diff(v1, v2)`: Returns difference between two versions by the release type
|
|
358
424
|
(`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`),
|
|
359
425
|
or null if the versions are the same.
|
|
@@ -382,6 +448,16 @@ strings that they parse.
|
|
|
382
448
|
`hilo` argument must be either the string `'>'` or `'<'`. (This is
|
|
383
449
|
the function called by `gtr` and `ltr`.)
|
|
384
450
|
* `intersects(range)`: Return true if any of the ranges comparators intersect
|
|
451
|
+
* `simplifyRange(versions, range)`: Return a "simplified" range that
|
|
452
|
+
matches the same items in `versions` list as the range specified. Note
|
|
453
|
+
that it does *not* guarantee that it would match the same versions in all
|
|
454
|
+
cases, only for the set of versions provided. This is useful when
|
|
455
|
+
generating ranges by joining together multiple versions with `||`
|
|
456
|
+
programmatically, to provide the user with something a bit more
|
|
457
|
+
ergonomic. If the provided range is shorter in string-length than the
|
|
458
|
+
generated range, then that is returned.
|
|
459
|
+
* `subset(subRange, superRange)`: Return `true` if the `subRange` range is
|
|
460
|
+
entirely contained by the `superRange` range.
|
|
385
461
|
|
|
386
462
|
Note that, since ranges may be non-contiguous, a version might not be
|
|
387
463
|
greater than a range, less than a range, *or* satisfy a range! For
|
|
@@ -396,7 +472,7 @@ range, use the `satisfies(version, range)` function.
|
|
|
396
472
|
|
|
397
473
|
### Coercion
|
|
398
474
|
|
|
399
|
-
* `coerce(version)`: Coerces a string to semver if possible
|
|
475
|
+
* `coerce(version, options)`: Coerces a string to semver if possible
|
|
400
476
|
|
|
401
477
|
This aims to provide a very forgiving translation of a non-semver string to
|
|
402
478
|
semver. It looks for the first digit in a string, and consumes all
|
|
@@ -410,3 +486,81 @@ coercion is 16 characters; longer components will be ignored
|
|
|
410
486
|
(`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any
|
|
411
487
|
semver component is `Number.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value
|
|
412
488
|
components are invalid (`9999999999999999.4.7.4` is likely invalid).
|
|
489
|
+
|
|
490
|
+
If the `options.rtl` flag is set, then `coerce` will return the right-most
|
|
491
|
+
coercible tuple that does not share an ending index with a longer coercible
|
|
492
|
+
tuple. For example, `1.2.3.4` will return `2.3.4` in rtl mode, not
|
|
493
|
+
`4.0.0`. `1.2.3/4` will return `4.0.0`, because the `4` is not a part of
|
|
494
|
+
any other overlapping SemVer tuple.
|
|
495
|
+
|
|
496
|
+
### Clean
|
|
497
|
+
|
|
498
|
+
* `clean(version)`: Clean a string to be a valid semver if possible
|
|
499
|
+
|
|
500
|
+
This will return a cleaned and trimmed semver version. If the provided
|
|
501
|
+
version is not valid a null will be returned. This does not work for
|
|
502
|
+
ranges.
|
|
503
|
+
|
|
504
|
+
ex.
|
|
505
|
+
* `s.clean(' = v 2.1.5foo')`: `null`
|
|
506
|
+
* `s.clean(' = v 2.1.5foo', { loose: true })`: `'2.1.5-foo'`
|
|
507
|
+
* `s.clean(' = v 2.1.5-foo')`: `null`
|
|
508
|
+
* `s.clean(' = v 2.1.5-foo', { loose: true })`: `'2.1.5-foo'`
|
|
509
|
+
* `s.clean('=v2.1.5')`: `'2.1.5'`
|
|
510
|
+
* `s.clean(' =v2.1.5')`: `2.1.5`
|
|
511
|
+
* `s.clean(' 2.1.5 ')`: `'2.1.5'`
|
|
512
|
+
* `s.clean('~1.0.0')`: `null`
|
|
513
|
+
|
|
514
|
+
## Exported Modules
|
|
515
|
+
|
|
516
|
+
<!--
|
|
517
|
+
TODO: Make sure that all of these items are documented (classes aren't,
|
|
518
|
+
eg), and then pull the module name into the documentation for that specific
|
|
519
|
+
thing.
|
|
520
|
+
-->
|
|
521
|
+
|
|
522
|
+
You may pull in just the part of this semver utility that you need, if you
|
|
523
|
+
are sensitive to packing and tree-shaking concerns. The main
|
|
524
|
+
`require('semver')` export uses getter functions to lazily load the parts
|
|
525
|
+
of the API that are used.
|
|
526
|
+
|
|
527
|
+
The following modules are available:
|
|
528
|
+
|
|
529
|
+
* `require('semver')`
|
|
530
|
+
* `require('semver/classes')`
|
|
531
|
+
* `require('semver/classes/comparator')`
|
|
532
|
+
* `require('semver/classes/range')`
|
|
533
|
+
* `require('semver/classes/semver')`
|
|
534
|
+
* `require('semver/functions/clean')`
|
|
535
|
+
* `require('semver/functions/cmp')`
|
|
536
|
+
* `require('semver/functions/coerce')`
|
|
537
|
+
* `require('semver/functions/compare')`
|
|
538
|
+
* `require('semver/functions/compare-build')`
|
|
539
|
+
* `require('semver/functions/compare-loose')`
|
|
540
|
+
* `require('semver/functions/diff')`
|
|
541
|
+
* `require('semver/functions/eq')`
|
|
542
|
+
* `require('semver/functions/gt')`
|
|
543
|
+
* `require('semver/functions/gte')`
|
|
544
|
+
* `require('semver/functions/inc')`
|
|
545
|
+
* `require('semver/functions/lt')`
|
|
546
|
+
* `require('semver/functions/lte')`
|
|
547
|
+
* `require('semver/functions/major')`
|
|
548
|
+
* `require('semver/functions/minor')`
|
|
549
|
+
* `require('semver/functions/neq')`
|
|
550
|
+
* `require('semver/functions/parse')`
|
|
551
|
+
* `require('semver/functions/patch')`
|
|
552
|
+
* `require('semver/functions/prerelease')`
|
|
553
|
+
* `require('semver/functions/rcompare')`
|
|
554
|
+
* `require('semver/functions/rsort')`
|
|
555
|
+
* `require('semver/functions/satisfies')`
|
|
556
|
+
* `require('semver/functions/sort')`
|
|
557
|
+
* `require('semver/functions/valid')`
|
|
558
|
+
* `require('semver/ranges/gtr')`
|
|
559
|
+
* `require('semver/ranges/intersects')`
|
|
560
|
+
* `require('semver/ranges/ltr')`
|
|
561
|
+
* `require('semver/ranges/max-satisfying')`
|
|
562
|
+
* `require('semver/ranges/min-satisfying')`
|
|
563
|
+
* `require('semver/ranges/min-version')`
|
|
564
|
+
* `require('semver/ranges/outside')`
|
|
565
|
+
* `require('semver/ranges/to-comparators')`
|
|
566
|
+
* `require('semver/ranges/valid')`
|