You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A small library which parses and manipulates comma-delimited integer ranges (such as "1-3,8-10").
8
-
Such strings are typically used in print dialogs to indicate which pages to print.
7
+
A small library which parses and manipulates comma-delimited integer ranges (such as "1-3,8-10"), which are typically used in print dialogs to indicate which pages to print.
9
8
10
-
Supported operations include:
9
+
Supported operations:
11
10
12
11
- Addition (e.g., `1-2,6` + `3-5` => `1-6`)
13
12
- Subtraction (e.g., `1-10` - `5-9` => `1-4,10`)
@@ -16,19 +15,17 @@ Supported operations include:
16
15
- Unbounded ranges (e.g., `5-` to mean "all integers >= 5") (optional)
17
16
- Ranges including negative integers or zero
18
17
- ES6 iterator (`for ... of`, spread operator)
19
-
- Array creation (a.k.a. "flatten")
18
+
- Array creation ("flatten")
20
19
21
-
Internal data are always *sorted and normalized* to the smallest possible
22
-
representation.
20
+
Internal data are always *sorted and normalized* to the smallest possible representation.
23
21
24
22
## Usage
25
23
26
24
### Install
27
25
28
-
Install via npm: `npm install multi-integer-range`
29
-
30
-
This library has no external dependencies, and can be used with Webpack and Browserify.
26
+
Install via npm or yarn: `npm install multi-integer-range`
31
27
28
+
This library has no external dependencies, and can be used with module bundlers such as Webpack.
32
29
33
30
### Basic Example
34
31
@@ -63,32 +60,26 @@ An initializer is one of the followings:
63
60
64
61
Pass it to the constructor to create a MultiRange object,
65
62
or pass nothing to create an empty MultiRange object.
63
+
A shorthand constructor function `multirange()` is also available,
0 commit comments