UNPKG

rc-js-util

Version:

A collection of TS and C++ utilities to help writing performant and correct applications, achieved through strict typing and (removable) invariant checking.

20 lines 493 B
import { _Debug } from "./_debug.js"; /** * @public */ export class DebugWeakStore { constructor(values = new WeakMap()) { this.values = values; } setValue(key, value) { this.values.set(key, value); } deleteValue(key) { this.values.delete(key); } getValue(key) { _BUILD.DEBUG && _Debug.assert(this.values.has(key), "expected to find value"); return this.values.get(key); } } //# sourceMappingURL=debug-weak-store.js.map