UNPKG

admob-ssv

Version:

Tool for validate AdMob rewarded ads signatures SSV

24 lines 874 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const memory_1 = __importDefault(require("./cache/memory")); const fetcher_1 = __importDefault(require("./fetcher")); class KeyProvider { constructor(options = {}) { this.cache = options.cache || new memory_1.default(); this.fetcher = options.fetcher || new fetcher_1.default(); } async get(keyId) { if (!(await this.cache.has(keyId))) { const keys = await this.fetcher.fetch(); for (const rawKey of keys) { await this.cache.save(rawKey); } } return await this.cache.get(keyId); } } exports.default = KeyProvider; //# sourceMappingURL=provider.js.map