UNPKG

@nomicfoundation/ethereumjs-statemanager

Version:
33 lines 1.15 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Cache = void 0; const debug_1 = require("debug"); const { debug: createDebugLogger } = debug_1.default; class Cache { constructor() { this._checkpoints = 0; this._stats = { size: 0, reads: 0, hits: 0, writes: 0, dels: 0, }; /** * StateManager cache is run in DEBUG mode (default: false) * Taken from DEBUG environment variable * * Safeguards on debug() calls are added for * performance reasons to avoid string literal evaluation * @hidden */ this.DEBUG = false; // Skip DEBUG calls unless 'ethjs' included in environmental DEBUG variables // Additional window check is to prevent vite browser bundling (and potentially other) to break this.DEBUG = typeof window === 'undefined' ? process?.env?.DEBUG?.includes('ethjs') ?? false : false; this._debug = createDebugLogger('statemanager:cache'); } } exports.Cache = Cache; //# sourceMappingURL=cache.js.map