8000 Add missing toStack method · sxhao/immutable-js@a5bf8d7 · GitHub
[go: up one dir, main page]

Skip to content

Commit a5bf8d7

Browse files
committed
Add missing toStack method
1 parent e41d99e commit a5bf8d7

File tree

5 files changed

+32
-4
lines changed

5 files changed

+32
-4
lines changed

dist/Immutable.d.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,15 @@ declare module 'immutable' {
201201
*/
202202
toSet(): Set<V>;
203203

204+
/**
205+
* Converts this sequence to a Stack, discarding keys. Throws if values
206+
* are not hashable.
207+
*
208+
* Note: This is equivalent to `Stack.from(this)`, but provided to allow for
209+
* chained expressions.
210+
*/
211+
toStack(): Stack<V>;
212+
204213
/**
205214
* Converts this sequence to a Vector, discarding keys.
206215
*

dist/Immutable.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,10 @@ var $Sequence = Sequence;
274274
assertNotInfinite(this.length);
275275
return Set.from(this);
276276
},
277+
toStack: function() {
278+
assertNotInfinite(this.length);
279+
return Stack.from(this);
280+
},
277281
toVector: function() {
278282
assertNotInfinite(this.length);
279283
return Vector.from(this);

0 commit comments

Comments
 (0)
0