semver 5.0.3 → 5.1.0

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/README.md CHANGED
@@ -107,7 +107,7 @@ The method `.inc` takes an additional `identifier` string argument that
107
107
  will append the value of the string as a prerelease identifier:
108
108
 
109
109
  ```javascript
110
- > semver.inc('1.2.3', 'pre', 'beta')
110
+ > semver.inc('1.2.3', 'prerelease', 'beta')
111
111
  '1.2.4-beta.0'
112
112
  ```
113
113
 
@@ -228,6 +228,30 @@ zero.
228
228
  * `^1.x` := `>=1.0.0 <2.0.0`
229
229
  * `^0.x` := `>=0.0.0 <1.0.0`
230
230
 
231
+ ### Range Grammar
232
+
233
+ Putting all this together, here is a Backus-Naur grammar for ranges,
234
+ for the benefit of parser authors:
235
+
236
+ ```bnf
237
+ range-set ::= range ( logical-or range ) *
238
+ logical-or ::= ( ' ' ) * '||' ( ' ' ) *
239
+ range ::= hyphen | simple ( ' ' simple ) * | ''
240
+ hyphen ::= partial ' - ' partial
241
+ simple ::= primitive | partial | tilde | caret
242
+ primitive ::= ( '<' | '>' | '>=' | '<=' | '=' | ) partial
243
+ partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
244
+ xr ::= 'x' | 'X' | '*' | nr
245
+ nr ::= '0' | ['1'-'9']['0'-'9']+
246
+ tilde ::= '~' partial
247
+ caret ::= '^' partial
248
+ qualifier ::= ( '-' pre )? ( '+' build )?
249
+ pre ::= parts
250
+ build ::= parts
251
+ parts ::= part ( '.' part ) *
252
+ part ::= nr | [-0-9A-Za-z]+
253
+ ```
254
+
231
255
  ## Functions
232
256
 
233
257
  All methods and classes take a final `loose` boolean argument that, if
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "semver",
3
- "version": "5.0.3",
3
+ "version": "5.1.0",
4
4
  "description": "The semantic version parser used by npm.",
5
5
  "main": "semver.js",
6
6
  "scripts": {
7
7
  "test": "tap test/*.js"
8
8
  },
9
9
  "devDependencies": {
10
- "tap": "^1.3.4"
10
+ "tap": "^2.0.0"
11
11
  },
12
12
  "license": "ISC",
13
13
  "repository": "https://github.com/npm/node-semver",
package/range.bnf ADDED
@@ -0,0 +1,16 @@
1
+ range-set ::= range ( logical-or range ) *
2
+ logical-or ::= ( ' ' ) * '||' ( ' ' ) *
3
+ range ::= hyphen | simple ( ' ' simple ) * | ''
4
+ hyphen ::= partial ' - ' partial
5
+ simple ::= primitive | partial | tilde | caret
6
+ primitive ::= ( '<' | '>' | '>=' | '<=' | '=' | ) partial
7
+ partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
8
+ xr ::= 'x' | 'X' | '*' | nr
9
+ nr ::= '0' | ['1'-'9']['0'-'9']+
10
+ tilde ::= '~' partial
11
+ caret ::= '^' partial
12
+ qualifier ::= ( '-' pre )? ( '+' build )?
13
+ pre ::= parts
14
+ build ::= parts
15
+ parts ::= part ( '.' part ) *
16
+ part ::= nr | [-0-9A-Za-z]+
package/semver.js CHANGED
@@ -332,10 +332,6 @@ SemVer.prototype.format = function() {
332
332
  return this.version;
333
333
  };
334
334
 
335
- SemVer.prototype.inspect = function() {
336
- return '<SemVer "' + this + '">';
337
- };
338
-
339
335
  SemVer.prototype.toString = function() {
340
336
  return this.version;
341
337
  };
@@ -692,10 +688,6 @@ Comparator.prototype.parse = function(comp) {
692
688
  this.semver = new SemVer(m[2], this.loose);
693
689
  };
694
690
 
695
- Comparator.prototype.inspect = function() {
696
- return '<SemVer Comparator "' + this + '">';
697
- };
698
-
699
691
  Comparator.prototype.toString = function() {
700
692
  return this.value;
701
693
  };
@@ -739,10 +731,6 @@ function Range(range, loose) {
739
731
  this.format();
740
732
  }
741
733
 
742
- Range.prototype.inspect = function() {
743
- return '<SemVer Range "' + this.range + '">';
744
- };
745
-
746
734
  Range.prototype.format = function() {
747
735
  this.range = this.set.map(function(comps) {
748
736
  return comps.join(' ').trim();