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

Method constructor

src/Set.js:16–27  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

14 // @pragma Construction
15
16 constructor(value) {
17 // eslint-disable-next-line no-constructor-return
18 return value === undefined || value === null
19 ? emptySet()
20 : isSet(value) && !isOrdered(value)
21 ? value
22 : emptySet().withMutations((set) => {
23 const iter = SetCollection(value);
24 assertNotInfinite(iter.size);
25 iter.forEach((v) => set.add(v));
26 });
27 }
28
29 static of(/*...values*/) {
30 return this(arguments);

Callers 2

unionMethod · 0.95
mergeIntoKeyedWithFunction · 0.45

Calls 8

isSetFunction · 0.90
isOrderedFunction · 0.90
SetCollectionClass · 0.90
emptySetFunction · 0.85
assertNotInfiniteFunction · 0.85
forEachMethod · 0.80
withMutationsMethod · 0.65
addMethod · 0.65

Tested by

no test coverage detected