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
Copy file name to clipboardExpand all lines: README.md
+13-5Lines changed: 13 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -101,20 +101,24 @@ To get the copy of the instance, use `clone()`, or alternatively the copy constr
101
101
102
102
-`new MultiRange(data?: Initializer)` Creates a new MultiRange object.
103
103
-`clone(): MultiRange` Clones this instance.
104
-
-`append(value: Initializer): MultiRange` Appends to this instance.
105
-
-`subtract(value: Initializer): MultiRange` Subtracts from this instance.
104
+
-`append(value: Initializer): MultiRange` Appends `value`to this instance.
105
+
-`subtract(value: Initializer): MultiRange` Subtracts `value`from this instance.
106
106
-`intersect(value: Initializer): MultiRange` Remove integers which are not included in `value` (aka intersection).
107
-
-`has(value: Initializer): boolean` Checks if the instance contains the specified value.
108
-
-`length(): number` Calculates how many numbers are effectively included in this instance. (ie, 5 for '3,5-7,9')
107
+
-`has(value: Initializer): boolean` Checks if the instance contains `value`.
108
+
-`length(): number` Calculates how many numbers are effectively included in this instance (ie, 5 for '3,5-7,9'). Returns Inifnity for an unbounded range.
109
109
-`segmentLength(): number` Returns the number of range segments (ie, 3 for '3,5-7,9' and 0 for an empty range)
110
110
-`equals(cmp: Initializer): boolean` Checks if two MultiRange data are identical.
111
111
-`isUnbounded(): boolean` Returns if the instance is unbounded.
112
+
-`min(): number | undefined` Returns the minimum integer. May return -Infinity.
113
+
-`max(): number | undefined` Returns the maxinum integer. May return Infinity.
114
+
-`shift(): number | undefined` Removes the minimum integer and returns it.
115
+
-`pop(): number | undefined` Removes the maxinum integer and returns it.
112
116
-`toString(): string` Returns the string respresentation of this MultiRange.
113
117
-`getRanges(): [number, number][]` Exports the whole range data as an array of [number, number] arrays.
114
118
-`toArray(): number[]` Builds an array of integer which holds all integers in this MultiRange. Note that this may be slow and memory-consuming for large ranges such as '1-10000'.
115
119
-`getIterator(): Object` Returns ES6-compatible iterator. See the description below.
116
120
117
-
The following methods are deprecated and may be removed in future releases:
121
+
The following methods were removed:
118
122
119
123
-`appendRange(min: number, max: number): MultiRange` Use `append([[min, max]])` instead.
120
124
-`subtractRange(min: number, max: number): MultiRange` Use `subtract([[min, max]])` instead.
0 commit comments