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

Method constructor

src/OrderedMap.js:12–23  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

10 // @pragma Construction
11
12 constructor(value) {
13 // eslint-disable-next-line no-constructor-return
14 return value === undefined || value === null
15 ? emptyOrderedMap()
16 : isOrderedMap(value)
17 ? value
18 : emptyOrderedMap().withMutations((map) => {
19 const iter = KeyedCollection(value);
20 assertNotInfinite(iter.size);
21 iter.forEach((v, k) => map.set(k, v));
22 });
23 }
24
25 static of(/*...values*/) {
26 return this(arguments);

Callers

nothing calls this directly

Calls 7

isOrderedMapFunction · 0.90
KeyedCollectionClass · 0.90
emptyOrderedMapFunction · 0.85
assertNotInfiniteFunction · 0.85
forEachMethod · 0.80
withMutationsMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected