@lodestar/beacon-node
Version:
A Typescript implementation of the beacon chain
20 lines • 425 B
JavaScript
/**
* A cache to store the serialized version of an object
*
* This is a thin wrapper around WeakMap
*/
export class SerializedCache {
constructor() {
this.map = new WeakMap();
}
get(obj) {
return this.map.get(obj);
}
set(obj, serialized) {
this.map.set(obj, serialized);
}
clear() {
this.map = new WeakMap();
}
}
//# sourceMappingURL=serializedCache.js.map