mirror of
https://github.com/oven-sh/bun
synced 2026-02-15 21:32:05 +00:00
New methods provide common atomic operations: - getOrSetItem(key, defaultValue): Get existing value or set and return default - Thread-safe get-or-insert pattern - Useful for lazy initialization and caching - takeItem(key): Get value and remove atomically, return null if not found - Thread-safe consume pattern - Useful for work queues and one-time operations Both methods maintain thread safety with proper locking and isolated string copies. Comprehensive test coverage added for all edge cases. Removed vision document as requested. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>