MCPcopy Create free account
hub / github.com/apache/cassandra-nodejs-driver / clear

Method clear

lib/host.js:623–636  ·  view source on GitHub ↗

* Removes all items from the map. * @returns {Array. } The previous items

()

Source from the content-addressed store, hash-verified

621 * @returns {Array.<Host>} The previous items
622 */
623 clear() {
624 const previousItems = this.values();
625
626 // Clear cache
627 this._values = null;
628
629 // Clear items
630 this._items = new Map();
631
632 // Emit events
633 previousItems.forEach(h => this.emit('remove', h));
634
635 return previousItems;
636 }
637
638 inspect() {
639 return this._items;

Callers 6

resetMethod · 0.45
clearAndInvokePendingMethod · 0.45

Calls 2

valuesMethod · 0.95
forEachMethod · 0.65

Tested by

no test coverage detected