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

Method clear

src/Map.js:84–96  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

82 }
83
84 clear() {
85 if (this.size === 0) {
86 return this;
87 }
88 if (this.__ownerID) {
89 this.size = 0;
90 this._root = null;
91 this.__hash = undefined;
92 this.__altered = true;
93 return this;
94 }
95 return emptyMap();
96 }
97
98 // @pragma Composition
99

Callers

nothing calls this directly

Calls 1

emptyMapFunction · 0.85

Tested by

no test coverage detected