MCPcopy Create free account
hub / github.com/WebReflection/weak-value / set

Method set

cjs/index.js:68–73  ·  view source on GitHub ↗
(key, value, onValueCollected = noop)

Source from the content-addressed store, hash-verified

66 }
67
68 set(key, value, onValueCollected = noop) {
69 super.delete(key);
70 const ref = new WeakRef(value);
71 this.#registry.register(value, key, ref);
72 return super.set(key, [ref, onValueCollected]);
73 }
74
75 *[iterator]() {
76 for (const [key, pair] of super[iterator]()) {

Callers 1

constructorMethod · 0.95

Calls 1

deleteMethod · 0.45

Tested by

no test coverage detected