UNPKG

html-reporter

Version:

Html-reporter and GUI for viewing and managing results of a tests run. Currently supports Testplane and Hermione.

29 lines 743 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Cache = void 0; class Cache { constructor(hashFn) { this._getKeyHash = hashFn; this._cache = new Map(); } has(key) { const keyHash = this._getKeyHash(key); return this._cache.has(keyHash); } get(key) { const keyHash = this._getKeyHash(key); return this._cache.get(keyHash); } set(key, value) { const keyHash = this._getKeyHash(key); if (value !== undefined) { this._cache.set(keyHash, value); } else { this._cache.delete(keyHash); } return this; } } exports.Cache = Cache; //# sourceMappingURL=cache.js.map