UNPKG

galeforce-tmp-sea

Version:

A customizable, promise-based, and command-oriented TypeScript library for the Riot Games API.

29 lines 1.16 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TakesVersion = void 0; /** * A mixin for the `.version()` method. * @template TBase The type of the object inside. Inferred from the `Base` parameter. * @param Base The target class. */ function TakesVersion(Base) { return class extends Base { /** * Modifies the **version** (patch) associated with the Action object it is called from. * Tests the provided version against the following regex expressions: * - `/^([0-9]+)\.([0-9]+)\.([0-9]+)$/` * - `/^lolpatch_([0-9]+)\.([0-9]+)$/` * * If the input fails to match one of the above expressions, an error will be thrown. * @param version The version to update the calling Action object with. * @throws Will throw an error if the provided locale does not match any of the above regex expressions. */ version(version) { this.payload.version = version; this.version = undefined; return this; } }; } exports.TakesVersion = TakesVersion; //# sourceMappingURL=version.js.map