lol-constants 3.2.6 → 3.2.7

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.
@@ -4,3 +4,4 @@ export declare function getChampion(id_key_name: ChampionId | ChampionKey | Cham
4
4
  export declare function isChampionId(id: number | null | undefined): id is ChampionId;
5
5
  export declare function isChampionKey(key: string | null | undefined): key is ChampionKey;
6
6
  export declare function isChampionName(name: string | null | undefined): name is ChampionName;
7
+ export declare function isChampion(id_key_name: number | string | null | undefined): id_key_name is ChampionId | ChampionKey | ChampionName;
@@ -17,3 +17,6 @@ export function isChampionKey(key) {
17
17
  export function isChampionName(name) {
18
18
  return typeof name == 'string' && name in championNames;
19
19
  }
20
+ export function isChampion(id_key_name) {
21
+ return typeof id_key_name == 'number' ? isChampionId(id_key_name) : (isChampionKey(id_key_name) || isChampionName(id_key_name));
22
+ }
@@ -37,3 +37,4 @@ export declare function isConsumableItem(item_id_name: typeof ItemsArr[number] |
37
37
  export declare function isItemAvailableOnMap(itemId: ItemId, mapId: MapId): boolean;
38
38
  export declare function isItemId(id: number | null | undefined): id is ItemId;
39
39
  export declare function isItemName(name: string | null | undefined): name is ItemName;
40
+ export declare function isItem(id_name: number | string | null | undefined): id_name is ItemId | ItemName;
@@ -126,3 +126,6 @@ export function isItemId(id) {
126
126
  export function isItemName(name) {
127
127
  return typeof name == 'string' && name in itemNames;
128
128
  }
129
+ export function isItem(id_name) {
130
+ return typeof id_name == 'number' ? isItemId(id_name) : isItemName(id_name);
131
+ }
@@ -28,9 +28,12 @@ export declare function getRuneTree(id_key_name: RuneTreeId | RuneTreeKey | Rune
28
28
  export declare function isRuneId(id: number | null | undefined): id is RuneId;
29
29
  export declare function isRuneKey(key: string | null | undefined): key is RuneKey;
30
30
  export declare function isRuneName(name: string | null | undefined): name is RuneName;
31
+ export declare function isRune(id_key_name: number | string | null | undefined): id_key_name is RuneId | RuneKey | RuneName;
31
32
  export declare function isStatRuneId(id: number | null | undefined): id is StatRuneId;
32
33
  export declare function isStatRuneName(name: string | null | undefined): name is StatRuneName;
34
+ export declare function isStatRune(id_name: number | string | null | undefined): id_name is StatRuneId | StatRuneName;
33
35
  export declare function isRuneTreeId(id: number | null | undefined): id is RuneTreeId;
34
36
  export declare function isRuneTreeKey(key: string | null | undefined): key is RuneTreeKey;
35
37
  export declare function isRuneTreeName(name: string | null | undefined): name is RuneTreeName;
38
+ export declare function isRuneTree(id_key_name: number | string | null | undefined): id_key_name is RuneTreeId | RuneTreeKey | RuneTreeName;
36
39
  export {};
@@ -53,12 +53,18 @@ export function isRuneKey(key) {
53
53
  export function isRuneName(name) {
54
54
  return typeof name == 'string' && name in runeNames;
55
55
  }
56
+ export function isRune(id_key_name) {
57
+ return typeof id_key_name == 'number' ? isRuneId(id_key_name) : (isRuneKey(id_key_name) || isRuneName(id_key_name));
58
+ }
56
59
  export function isStatRuneId(id) {
57
60
  return typeof id == 'number' && id in StatRunes;
58
61
  }
59
62
  export function isStatRuneName(name) {
60
63
  return typeof name == 'string' && name in statRuneNames;
61
64
  }
65
+ export function isStatRune(id_name) {
66
+ return typeof id_name == 'number' ? isStatRuneId(id_name) : isStatRuneName(id_name);
67
+ }
62
68
  export function isRuneTreeId(id) {
63
69
  return typeof id == 'number' && id in RuneTrees;
64
70
  }
@@ -68,3 +74,6 @@ export function isRuneTreeKey(key) {
68
74
  export function isRuneTreeName(name) {
69
75
  return typeof name == 'string' && name in runeTreeNames;
70
76
  }
77
+ export function isRuneTree(id_key_name) {
78
+ return typeof id_key_name == 'number' ? isRuneTreeId(id_key_name) : (isRuneTreeKey(id_key_name) || isRuneTreeName(id_key_name));
79
+ }
@@ -4,3 +4,4 @@ export declare function getSpell(id_key_name: SpellId | SpellKey | SpellName): t
4
4
  export declare function isSpellId(id: number | null | undefined): id is SpellId;
5
5
  export declare function isSpellKey(key: string | null | undefined): key is SpellKey;
6
6
  export declare function isSpellName(name: string | null | undefined): name is SpellName;
7
+ export declare function isSpell(id_key_name: number | string | null | undefined): id_key_name is SpellId | SpellKey | SpellName;
@@ -17,3 +17,6 @@ export function isSpellKey(key) {
17
17
  export function isSpellName(name) {
18
18
  return typeof name == 'string' && name in spellNames;
19
19
  }
20
+ export function isSpell(id_key_name) {
21
+ return typeof id_key_name == 'number' ? isSpellId(id_key_name) : (isSpellKey(id_key_name) || isSpellName(id_key_name));
22
+ }
package/dist/index.d.ts CHANGED
@@ -8,16 +8,16 @@ export * from './constants/locales';
8
8
  export * from './constants/participants';
9
9
  export { ItemSrTypes } from './enums/ItemSrTypes';
10
10
  export { StatRuneSlots } from './enums/StatRuneSlots';
11
- export { getChampion, isChampionId, isChampionKey, isChampionName, } from './helpers/champion';
12
- export { getItem, isStarterItem, isBasicItem, isEpicItem, isLegendaryItem, isTrinketItem, isBootsItem, isConsumableItem, isItemAvailableOnMap, isItemId, isItemName, } from './helpers/item';
11
+ export { getChampion, isChampionId, isChampionKey, isChampionName, isChampion, } from './helpers/champion';
12
+ export { getItem, isStarterItem, isBasicItem, isEpicItem, isLegendaryItem, isTrinketItem, isBootsItem, isConsumableItem, isItemAvailableOnMap, isItemId, isItemName, isItem, } from './helpers/item';
13
13
  export type { RiotId } from './helpers/riotId';
14
14
  export { makeRiotId, splitRiotId, validateRiotId, } from './helpers/riotId';
15
- export { getRune, getStatRune, getRuneTree, isRuneId, isRuneKey, isRuneName, isStatRuneId, isStatRuneName, isRuneTreeId, isRuneTreeKey, isRuneTreeName, } from './helpers/rune';
16
- export { getSpell, isSpellId, isSpellKey, isSpellName, } from './helpers/spell';
15
+ export { getRune, getStatRune, getRuneTree, isRuneId, isRuneKey, isRuneName, isRune, isStatRuneId, isStatRuneName, isStatRune, isRuneTreeId, isRuneTreeKey, isRuneTreeName, isRuneTree, } from './helpers/rune';
16
+ export { getSpell, isSpellId, isSpellKey, isSpellName, isSpell, } from './helpers/spell';
17
17
  export type { MapId, MapTitle } from './objects/Maps';
18
18
  export { MapsArr as Maps, getMap, isMapId, isMapTitle } from './objects/Maps';
19
19
  export type { QueueId, QueueTitle } from './objects/Queues';
20
- export { QueuesArr as Queues, isQueueId, isQueueTitle, getQueue, } from './objects/Queues';
20
+ export { QueuesArr as Queues, isQueueId, isQueueTitle, isQueue, getQueue, } from './objects/Queues';
21
21
  export type { Platform, Region } from './objects/Regions';
22
22
  export { RegionsArr as Regions, getRegion, isPlatform, isRegion, } from './objects/Regions';
23
23
  export { ChampionsArr as Champions } from './objects/generated/Champions';
package/dist/index.js CHANGED
@@ -12,13 +12,13 @@ export * from './constants/participants';
12
12
  export { ItemSrTypes } from './enums/ItemSrTypes';
13
13
  export { StatRuneSlots } from './enums/StatRuneSlots';
14
14
  // # helpers
15
- export { getChampion, isChampionId, isChampionKey, isChampionName, } from './helpers/champion';
16
- export { getItem, isStarterItem, isBasicItem, isEpicItem, isLegendaryItem, isTrinketItem, isBootsItem, isConsumableItem, isItemAvailableOnMap, isItemId, isItemName, } from './helpers/item';
15
+ export { getChampion, isChampionId, isChampionKey, isChampionName, isChampion, } from './helpers/champion';
16
+ export { getItem, isStarterItem, isBasicItem, isEpicItem, isLegendaryItem, isTrinketItem, isBootsItem, isConsumableItem, isItemAvailableOnMap, isItemId, isItemName, isItem, } from './helpers/item';
17
17
  export { makeRiotId, splitRiotId, validateRiotId, } from './helpers/riotId';
18
- export { getRune, getStatRune, getRuneTree, isRuneId, isRuneKey, isRuneName, isStatRuneId, isStatRuneName, isRuneTreeId, isRuneTreeKey, isRuneTreeName, } from './helpers/rune';
19
- export { getSpell, isSpellId, isSpellKey, isSpellName, } from './helpers/spell';
18
+ export { getRune, getStatRune, getRuneTree, isRuneId, isRuneKey, isRuneName, isRune, isStatRuneId, isStatRuneName, isStatRune, isRuneTreeId, isRuneTreeKey, isRuneTreeName, isRuneTree, } from './helpers/rune';
19
+ export { getSpell, isSpellId, isSpellKey, isSpellName, isSpell, } from './helpers/spell';
20
20
  export { MapsArr as Maps, getMap, isMapId, isMapTitle } from './objects/Maps';
21
- export { QueuesArr as Queues, isQueueId, isQueueTitle, getQueue, } from './objects/Queues';
21
+ export { QueuesArr as Queues, isQueueId, isQueueTitle, isQueue, getQueue, } from './objects/Queues';
22
22
  export { RegionsArr as Regions, getRegion, isPlatform, isRegion, } from './objects/Regions';
23
23
  // ## generated
24
24
  export { ChampionsArr as Champions } from './objects/generated/Champions';
@@ -342,5 +342,6 @@ export type QueueId = typeof QueuesArr[number]['id'];
342
342
  export type QueueTitle = typeof QueuesArr[number]['title'];
343
343
  export declare function isQueueId(id: number | null | undefined): id is QueueId;
344
344
  export declare function isQueueTitle(title: string | null | undefined): title is QueueTitle;
345
+ export declare function isQueue(id_title: number | string | null | undefined): id_title is QueueId | QueueTitle;
345
346
  /** Get queue by its **id** or **title**. */
346
347
  export declare function getQueue(id_title: QueueId | QueueTitle): typeof Queues[keyof typeof Queues];
@@ -120,6 +120,9 @@ export function isQueueId(id) {
120
120
  export function isQueueTitle(title) {
121
121
  return typeof title == 'string' && title in queueTitles;
122
122
  }
123
+ export function isQueue(id_title) {
124
+ return typeof id_title == 'number' ? isQueueId(id_title) : isQueueTitle(id_title);
125
+ }
123
126
  /** Get queue by its **id** or **title**. */
124
127
  export function getQueue(id_title) {
125
128
  var _a, _b;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lol-constants",
3
- "version": "3.2.6",
3
+ "version": "3.2.7",
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",