UNPKG

enkanetwork

Version:

API wrapper for enka.network written on TypeScript which provides localization, caching and convenience

20 lines (19 loc) 606 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.OriginAdapter = void 0; /** * Default adapter. Resolves a filename to a remote URL on the origin, without any * caching. Reproduces the historical `getAssetPath` behavior. */ class OriginAdapter { baseUrl; extension; constructor({ baseUrl = "https://enka.network/ui/", extension = ".png", } = {}) { this.baseUrl = baseUrl; this.extension = extension; } resolve(filename) { return `${this.baseUrl}${filename}${this.extension}`; } } exports.OriginAdapter = OriginAdapter;