File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 2
2
3
3
[ ![ Build Status] ( https://travis-ci.org/smikitky/node-multi-integer-range.svg?branch=master )] ( https://travis-ci.org/smikitky/node-multi-integer-range )
4
4
5
- A small library which parses and manipulates comma-delimited positive integer ranges (such as "1-3,8-10").
5
+ A small library which parses and manipulates comma-delimited integer ranges (such as "1-3,8-10").
6
6
7
7
Such strings are typically used in print dialogs to indicate which pages to print.
8
8
@@ -115,6 +115,17 @@ The following methods are deprecated and may be removed in future releases:
115
115
- ` hasRange(min: number, max: number): boolean ` Use ` has([[min, max]]) ` instead.
116
116
- ` isContinuous(): boolean ` Use ` segmentLength() === 1 ` instead.
117
117
118
+ ### Negative ranges
119
+
120
+ You can handle ranges containing zero or negative integers.
121
+ To pass negative integers to the string parser, always contain them in parentheses.
122
+
123
+ ``` js
124
+ var mr1 = new MultiRange (' (-5),(-1)-0' );
125
+ mr1 .append ([[- 4 , - 2 ]]); // -4 to -2
126
+ console .log (mr1 + ' ' ); // prints '(-5)-0'
127
+ ```
128
+
118
129
### Iteration
119
130
120
131
** ES6 iterator** : If ` Symbol.iterator ` is defined in the runtime,
You can’t perform that action at this time.
0 commit comments