@@ -28,8 +28,9 @@ var parseRange = require('range-parser')
28
28
29
29
### parseRange(size, header, options)
30
30
31
- Parse the given ` header ` string where ` size ` is the maximum size of the resource.
32
- An array of ranges will be returned or negative numbers indicating an error parsing.
31
+ Parse the given ` header ` string where ` size ` is the size of the selected
32
+ representation that is to be partitioned into subranges. An array of subranges
33
+ will be returned or negative numbers indicating an error parsing.
33
34
34
35
* ` -2 ` signals a malformed header string
35
36
* ` -1 ` signals an unsatisfiable range
@@ -38,12 +39,12 @@ An array of ranges will be returned or negative numbers indicating an error pars
38
39
39
40
``` js
40
41
// parse header from request
41
- var range = parseRange (size, req .headers .range )
42
+ var subranges = parseRange (size, req .headers .range )
42
43
43
- // the type of the range
44
- if (range .type === ' bytes' ) {
44
+ // the type of the subranges
45
+ if (subranges .type === ' bytes' ) {
45
46
// the ranges
46
- range .forEach (function (r ) {
47
+ subranges .forEach (function (r ) {
47
48
// do something with r.start and r.end
48
49
})
49
50
}
@@ -55,9 +56,9 @@ These properties are accepted in the options object.
55
56
56
57
##### combine
57
58
58
- Specifies if overlapping & adjacent ranges should be combined, defaults to ` false ` .
59
- When ` true ` , ranges will be combined and returned as if they were specified that
60
- way in the header.
59
+ Specifies if overlapping & adjacent subranges should be combined, defaults to
60
+ ` false ` . When ` true ` , ranges will be combined and returned as if they were
61
+ specified that way in the header.
61
62
62
63
<!-- eslint-disable no-undef -->
63
64
0 commit comments