Added optional xivApiKey to CardCreator

This commit is contained in:
Carlo Morgenstern 2021-10-24 16:40:47 +02:00
parent e6d9d10182
commit 2023697686
2 changed files with 4 additions and 2 deletions

View file

@ -91,8 +91,10 @@ class CardCreator {
/**
* Creates a new card creator.
* @constructor
* @param {string} [xivApiKey] The API key for the XIV API to be used in all requests.
*/
constructor() {
constructor(xivApiKey = undefined) {
this.xivApiKey = typeof xivApiKey === 'string' && xivApiKey !== '' ? xivApiKey : undefined;
this.isInit = false;
}