MCPcopy Index your code
hub / github.com/immutable-js/immutable-js / constructor

Method constructor

src/Map.js:37–48  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

35 // @pragma Construction
36
37 constructor(value) {
38 // eslint-disable-next-line no-constructor-return
39 return value === undefined || value === null
40 ? emptyMap()
41 : isMap(value) && !isOrdered(value)
42 ? value
43 : emptyMap().withMutations((map) => {
44 const iter = KeyedCollection(value);
45 assertNotInfinite(iter.size);
46 iter.forEach((v, k) => map.set(k, v));
47 });
48 }
49
50 toString() {
51 return this.__toString('Map {', '}');

Callers

nothing calls this directly

Calls 8

isMapFunction · 0.90
isOrderedFunction · 0.90
KeyedCollectionClass · 0.90
emptyMapFunction · 0.85
assertNotInfiniteFunction · 0.85
forEachMethod · 0.80
withMutationsMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected