Skip to content

Commit 5f48dfc

Browse files
committed
docs: update wording to reflect specification
1 parent f8ed0a7 commit 5f48dfc

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

README.md

+10-9
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ var parseRange = require('range-parser')
2828

2929
### parseRange(size, header, options)
3030

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.
3334

3435
* `-2` signals a malformed header string
3536
* `-1` signals an unsatisfiable range
@@ -38,12 +39,12 @@ An array of ranges will be returned or negative numbers indicating an error pars
3839

3940
```js
4041
// parse header from request
41-
var range = parseRange(size, req.headers.range)
42+
var subranges = parseRange(size, req.headers.range)
4243

43-
// the type of the range
44-
if (range.type === 'bytes') {
44+
// the type of the subranges
45+
if (subranges.type === 'bytes') {
4546
// the ranges
46-
range.forEach(function (r) {
47+
subranges.forEach(function (r) {
4748
// do something with r.start and r.end
4849
})
4950
}
@@ -55,9 +56,9 @@ These properties are accepted in the options object.
5556

5657
##### combine
5758

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.
6162

6263
<!-- eslint-disable no-undef -->
6364

0 commit comments

Comments
 (0)