galeforce-tmp-sea
Version:
A customizable, promise-based, and command-oriented TypeScript library for the Riot Games API.
26 lines • 1 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.TakesLocale = void 0;
/**
* A mixin for the `.locale()` method.
* @template TBase The type of the object inside. Inferred from the `Base` parameter.
* @param Base The target class.
*/
function TakesLocale(Base) {
return class extends Base {
/**
* Modifies the **locale** (language) associated with the Action object it is called from.
* The regex `/^[a-z]{2}_[A-Z]{2}$/` will be run against the provided input to ensure that
* a valid locale format is provided.
* @param locale The locale to update the calling Action object with.
* @throws Will throw an error if the provided locale does not match the above regex expression.
*/
locale(locale) {
this.payload.locale = locale;
this.locale = undefined;
return this;
}
};
}
exports.TakesLocale = TakesLocale;
//# sourceMappingURL=locale.js.map