Skip to main content
Jeden Skill in Manus ausführen
mit einem Klick

weak-storage

Sterne0
Forks0
Aktualisiert13. Mai 2026 um 19:20

A Map-like collection with weakly-referenced values built on WeakRef and FinalizationRegistry. Two classes: WeakValueMap<K, V> for key→value lookup with any key type, and WeakStorage<K, V> which adds a WeakMap-backed reverse index for O(1) value→key lookup. Use when building caches that should not prevent garbage collection, tracking object associations, or attaching metadata to objects without extending their lifetime. Values must be objects (WeakRef requirement — primitives throw at runtime). Iteration and get() silently skip collected entries. approximateSize may lag GC; call verify() for an accurate count or use has() which always checks liveness.

Installation

Mit Codex oder Claude installieren Kopieren Sie diesen Prompt, fügen Sie ihn in Codex, Claude oder einen anderen Assistant ein und lassen Sie die Skill-Seite prüfen und installieren.

SKILL.md
readonly