lol-constants 3.1.0 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,12 @@
1
1
  import { championKeys, championNames, Champions, failsafeChampion, } from '../objects/generated/Champions';
2
2
  /** Get a champion by its **id**, **key**, or **name**. */
3
3
  export function getChampion(id_key_name) {
4
- var _a;
4
+ var _a, _b, _c;
5
5
  if (typeof id_key_name == 'number')
6
- return Champions[id_key_name];
6
+ return (_a = Champions[id_key_name]) !== null && _a !== void 0 ? _a : failsafeChampion;
7
7
  if (isChampionKey(id_key_name))
8
- return Champions[championKeys[id_key_name]];
9
- return (_a = Champions[championNames[id_key_name]]) !== null && _a !== void 0 ? _a : failsafeChampion;
8
+ return (_b = Champions[championKeys[id_key_name]]) !== null && _b !== void 0 ? _b : failsafeChampion;
9
+ return (_c = Champions[championNames[id_key_name]]) !== null && _c !== void 0 ? _c : failsafeChampion;
10
10
  }
11
11
  export function isChampionId(id) {
12
12
  return typeof id == 'number' && id in Champions;
@@ -27,10 +27,10 @@ import { MapsArr } from '../objects/Maps';
27
27
  * Use `lol.item.isAvailable` to determine whether item is available on a certain map.
28
28
  */
29
29
  export function getItem(id_name, mapId = 11) {
30
- var _a;
30
+ var _a, _b;
31
31
  if (typeof id_name == 'number')
32
- return Items[id_name];
33
- return (_a = Items[getItemIdByName(id_name, mapId)]) !== null && _a !== void 0 ? _a : failsafeItem;
32
+ return (_a = Items[id_name]) !== null && _a !== void 0 ? _a : failsafeItem;
33
+ return (_b = Items[getItemIdByName(id_name, mapId)]) !== null && _b !== void 0 ? _b : failsafeItem;
34
34
  }
35
35
  /** @see `getItem` */
36
36
  function getItemIdByName(itemName, mapId = 11) {
@@ -1,12 +1,12 @@
1
1
  import { failsafeSpell, spellKeys, spellNames, Spells, } from '../objects/generated/Spells';
2
2
  /** Get a summoner spell by its **id**, **key** or **name**. */
3
3
  export function getSpell(id_key_name) {
4
- var _a;
4
+ var _a, _b, _c;
5
5
  if (typeof id_key_name == 'number')
6
- return Spells[id_key_name];
6
+ return (_a = Spells[id_key_name]) !== null && _a !== void 0 ? _a : failsafeSpell;
7
7
  if (isSpellKey(id_key_name))
8
- return Spells[spellKeys[id_key_name]];
9
- return (_a = Spells[spellNames[id_key_name]]) !== null && _a !== void 0 ? _a : failsafeSpell;
8
+ return (_b = Spells[spellKeys[id_key_name]]) !== null && _b !== void 0 ? _b : failsafeSpell;
9
+ return (_c = Spells[spellNames[id_key_name]]) !== null && _c !== void 0 ? _c : failsafeSpell;
10
10
  }
11
11
  export function isSpellId(id) {
12
12
  return typeof id == 'number' && id in Spells;
@@ -64,8 +64,8 @@ export function isMapTitle(title) {
64
64
  }
65
65
  /** Get map by its **id** or **title**. */
66
66
  export function getMap(id_title) {
67
- var _a;
67
+ var _a, _b;
68
68
  if (typeof id_title == 'number')
69
- return Maps[id_title];
70
- return (_a = Maps[mapTitles[id_title]]) !== null && _a !== void 0 ? _a : failsafeMap;
69
+ return (_a = Maps[id_title]) !== null && _a !== void 0 ? _a : failsafeMap;
70
+ return (_b = Maps[mapTitles[id_title]]) !== null && _b !== void 0 ? _b : failsafeMap;
71
71
  }
@@ -118,8 +118,8 @@ export function isQueueTitle(title) {
118
118
  }
119
119
  /** Get queue by its **id** or **title**. */
120
120
  export function getQueue(id_title) {
121
- var _a;
121
+ var _a, _b;
122
122
  if (typeof id_title == 'number')
123
- return Queues[id_title];
124
- return (_a = Queues[queueTitles[id_title]]) !== null && _a !== void 0 ? _a : failsafeQueue;
123
+ return (_a = Queues[id_title]) !== null && _a !== void 0 ? _a : failsafeQueue;
124
+ return (_b = Queues[queueTitles[id_title]]) !== null && _b !== void 0 ? _b : failsafeQueue;
125
125
  }
@@ -52,8 +52,8 @@ export function isPlatform(platform) {
52
52
  * Convert between the two.
53
53
  */
54
54
  export function getRegion(region_platform) {
55
- var _a;
55
+ var _a, _b;
56
56
  if (isRegion(region_platform))
57
- return Regions[region_platform];
58
- return (_a = Regions[platforms[region_platform]]) !== null && _a !== void 0 ? _a : failsafeRegion;
57
+ return (_a = Regions[region_platform]) !== null && _a !== void 0 ? _a : failsafeRegion;
58
+ return (_b = Regions[platforms[region_platform]]) !== null && _b !== void 0 ? _b : failsafeRegion;
59
59
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lol-constants",
3
- "version": "3.1.0",
3
+ "version": "3.1.1",
4
4
  "description": "League of Legends constants, functions, and types. Provides a plathera of functions to easily convert between ID, Name, and Key for champions, items, summoner spells, and runes.",
5
5
  "license": "MIT",
6
6
  "type": "module",