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

Method constructor

src/OrderedSet.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 ? emptyOrderedSet()
16 : isOrderedSet(value)
17 ? value
18 : emptyOrderedSet().withMutations((set) => {
19 const iter = SetCollection(value);
20 assertNotInfinite(iter.size);
21 iter.forEach((v) => set.add(v));
22 });
23 }
24
25 static of(/*...values*/) {
26 return this(arguments);

Callers

nothing calls this directly

Calls 7

isOrderedSetFunction · 0.90
SetCollectionClass · 0.90
emptyOrderedSetFunction · 0.85
assertNotInfiniteFunction · 0.85
forEachMethod · 0.80
withMutationsMethod · 0.65
addMethod · 0.65

Tested by

no test coverage detected