MCPcopy
hub / github.com/immutable-js/immutable-js / toArray

Function toArray

src/CollectionImpl.js:84–94  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

82 // ### Conversion to other types
83
84 toArray() {
85 assertNotInfinite(this.size);
86 const array = new Array(this.size || 0);
87 const useTuples = isKeyed(this);
88 let i = 0;
89 this.__iterate((v, k) => {
90 // Keyed collections produce an array of tuples.
91 array[i++] = useTuples ? [k, v] : v;
92 });
93 return array;
94 },
95
96 toIndexedSeq() {
97 return new ToIndexedSequence(this);

Callers

nothing calls this directly

Calls 3

isKeyedFunction · 0.90
assertNotInfiniteFunction · 0.85
__iterateMethod · 0.45

Tested by

no test coverage detected