lol-constants 0.9.0 → 0.9.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,2 @@
1
+ import { ChampionKey, ChampionName } from '../types';
2
+ export declare function getChampionKeyByName(name: ChampionName): ChampionKey;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getChampionKeyByName = void 0;
7
+ const championByName_json_1 = __importDefault(require("../generated/championByName.json"));
8
+ function getChampionKeyByName(name) {
9
+ return championByName_json_1.default.data[name].key;
10
+ }
11
+ exports.getChampionKeyByName = getChampionKeyByName;
@@ -0,0 +1,2 @@
1
+ import { ChampionKey, ChampionName } from '../types';
2
+ export declare function getChampionNameByKey(key: ChampionKey): ChampionName;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getChampionNameByKey = void 0;
7
+ const championByKey_json_1 = __importDefault(require("../generated/championByKey.json"));
8
+ function getChampionNameByKey(key) {
9
+ return championByKey_json_1.default.data[key].name;
10
+ }
11
+ exports.getChampionNameByKey = getChampionNameByKey;
@@ -0,0 +1,2 @@
1
+ import { ItemKey, ItemName } from '../types';
2
+ export declare function getItemKeyByName(name: ItemName): ItemKey;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getItemKeyByName = void 0;
7
+ const itemByName_json_1 = __importDefault(require("../generated/itemByName.json"));
8
+ function getItemKeyByName(name) {
9
+ return itemByName_json_1.default.data[name].key;
10
+ }
11
+ exports.getItemKeyByName = getItemKeyByName;
@@ -0,0 +1,2 @@
1
+ import { ItemKey, ItemName } from '../types';
2
+ export declare function getItemNameByKey(key: ItemKey): ItemName;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getItemNameByKey = void 0;
7
+ const item_json_1 = __importDefault(require("../assets/item.json"));
8
+ function getItemNameByKey(key) {
9
+ return item_json_1.default.data[key].name;
10
+ }
11
+ exports.getItemNameByKey = getItemNameByKey;
@@ -0,0 +1,2 @@
1
+ import { RuneId, RuneName } from '../types';
2
+ export declare function getRuneIdByName(name: RuneName): RuneId;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getRuneIdByName = void 0;
7
+ const runesByName_json_1 = __importDefault(require("../generated/runesByName.json"));
8
+ const StatRunes_1 = require("../Constants/StatRunes");
9
+ const isStatRuneName_1 = require("./isStatRuneName");
10
+ function getRuneIdByName(name) {
11
+ if ((0, isStatRuneName_1.isStatRuneName)(name)) {
12
+ let statRuneId;
13
+ for (statRuneId in StatRunes_1.StatRunes) {
14
+ if (StatRunes_1.StatRunes[statRuneId] == name)
15
+ return statRuneId;
16
+ }
17
+ return '5001';
18
+ }
19
+ return runesByName_json_1.default[name].id;
20
+ }
21
+ exports.getRuneIdByName = getRuneIdByName;
@@ -0,0 +1,2 @@
1
+ import { RuneId, RuneName } from '../types';
2
+ export declare function getRuneNameById(id: RuneId): RuneName;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getRuneNameById = void 0;
7
+ const runesById_json_1 = __importDefault(require("../generated/runesById.json"));
8
+ const StatRunes_1 = require("../Constants/StatRunes");
9
+ const isStatRuneId_1 = require("./isStatRuneId");
10
+ function getRuneNameById(id) {
11
+ if ((0, isStatRuneId_1.isStatRuneId)(id))
12
+ return StatRunes_1.StatRunes[id];
13
+ return runesById_json_1.default[id].name;
14
+ }
15
+ exports.getRuneNameById = getRuneNameById;
@@ -0,0 +1,2 @@
1
+ import { SummonerSpellKey, SummonerSpellName } from '../types';
2
+ export declare function getSummonerSpellKeyByName(name: SummonerSpellName): SummonerSpellKey;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getSummonerSpellKeyByName = void 0;
7
+ const summonerByName_json_1 = __importDefault(require("../generated/summonerByName.json"));
8
+ function getSummonerSpellKeyByName(name) {
9
+ return summonerByName_json_1.default.data[name].key;
10
+ }
11
+ exports.getSummonerSpellKeyByName = getSummonerSpellKeyByName;
@@ -0,0 +1,2 @@
1
+ import { SummonerSpellKey, SummonerSpellName } from '../types';
2
+ export declare function getSummonerSpellNameByKey(key: SummonerSpellKey): SummonerSpellName;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getSummonerSpellNameByKey = void 0;
7
+ const summonerByKey_json_1 = __importDefault(require("../generated/summonerByKey.json"));
8
+ function getSummonerSpellNameByKey(key) {
9
+ return summonerByKey_json_1.default.data[key].name;
10
+ }
11
+ exports.getSummonerSpellNameByKey = getSummonerSpellNameByKey;
@@ -0,0 +1,2 @@
1
+ import { StatRuneId } from '../types';
2
+ export declare function isStatRuneId(id: any): id is StatRuneId;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isStatRuneId = void 0;
4
+ const StatRuneIds_1 = require("../Constants/StatRuneIds");
5
+ function isStatRuneId(id) {
6
+ if (StatRuneIds_1.StatRuneIds.includes(id))
7
+ return true;
8
+ return false;
9
+ }
10
+ exports.isStatRuneId = isStatRuneId;
@@ -0,0 +1,2 @@
1
+ import { StatRuneName } from '../types';
2
+ export declare function isStatRuneName(name: any): name is StatRuneName;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isStatRuneName = void 0;
4
+ const StatRuneNames_1 = require("../Constants/StatRuneNames");
5
+ function isStatRuneName(name) {
6
+ if (StatRuneNames_1.StatRuneNames.includes(name))
7
+ return true;
8
+ return false;
9
+ }
10
+ exports.isStatRuneName = isStatRuneName;
@@ -0,0 +1,2 @@
1
+ import { TreeRuneId } from '../types';
2
+ export declare function isTreeRuneId(id: any): id is TreeRuneId;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isTreeRuneId = void 0;
4
+ const TreeRuneIds_1 = require("../Constants/TreeRuneIds");
5
+ function isTreeRuneId(id) {
6
+ if (TreeRuneIds_1.TreeRuneIds.includes(id))
7
+ return true;
8
+ return false;
9
+ }
10
+ exports.isTreeRuneId = isTreeRuneId;
@@ -0,0 +1,2 @@
1
+ import { TreeRuneName } from '../types';
2
+ export declare function isTreeRuneName(name: any): name is TreeRuneName;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isTreeRuneName = void 0;
4
+ const TreeRuneNames_1 = require("../Constants/TreeRuneNames");
5
+ function isTreeRuneName(name) {
6
+ if (TreeRuneNames_1.TreeRuneNames.includes(name))
7
+ return true;
8
+ return false;
9
+ }
10
+ exports.isTreeRuneName = isTreeRuneName;
package/dist/index.d.ts CHANGED
@@ -43397,14 +43397,26 @@ export declare const summonerByName: {
43397
43397
  };
43398
43398
  version: string;
43399
43399
  };
43400
+ export { getChampionKeyByName } from './Helpers/getChampionKeyByName';
43401
+ export { getChampionNameByKey } from './Helpers/getChampionNameByKey';
43402
+ export { getItemKeyByName } from './Helpers/getItemKeyByName';
43403
+ export { getItemNameByKey } from './Helpers/getItemNameByKey';
43404
+ export { getRuneIdByName } from './Helpers/getRuneIdByName';
43405
+ export { getRuneNameById } from './Helpers/getRuneNameById';
43406
+ export { getSummonerSpellKeyByName } from './Helpers/getSummonerSpellKeyByName';
43407
+ export { getSummonerSpellNameByKey } from './Helpers/getSummonerSpellNameByKey';
43400
43408
  export { isChampionKey } from './Helpers/isChampionKey';
43401
43409
  export { isChampionName } from './Helpers/isChampionName';
43402
43410
  export { isItemKey } from './Helpers/isItemKey';
43403
43411
  export { isItemName } from './Helpers/isItemName';
43404
43412
  export { isRuneId } from './Helpers/isRuneId';
43405
43413
  export { isRuneName } from './Helpers/isRuneName';
43414
+ export { isStatRuneId } from './Helpers/isStatRuneId';
43415
+ export { isStatRuneName } from './Helpers/isStatRuneName';
43406
43416
  export { isSummonerSpellId } from './Helpers/isSummonerSpellId';
43407
43417
  export { isSummonerSpellKey } from './Helpers/isSummonerSpellKey';
43408
43418
  export { isSummonerSpellName } from './Helpers/isSummonerSpellName';
43419
+ export { isTreeRuneId } from './Helpers/isTreeRuneId';
43420
+ export { isTreeRuneName } from './Helpers/isTreeRuneName';
43409
43421
  export * from './types';
43410
43422
  export * from './types/Meta';
package/dist/index.js CHANGED
@@ -17,7 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
17
17
  return (mod && mod.__esModule) ? mod : { "default": mod };
18
18
  };
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
- exports.isSummonerSpellName = exports.isSummonerSpellKey = exports.isSummonerSpellId = exports.isRuneName = exports.isRuneId = exports.isItemName = exports.isItemKey = exports.isChampionName = exports.isChampionKey = exports.summonerByName = exports.summonerByKey = exports.runesByName = exports.runesById = exports.itemByName = exports.championByName = exports.championByKey = exports.TreeRuneNames = exports.TreeRuneIds = exports.SummonerSpellNames = exports.SummonerSpellKeys = exports.SummonerSpellIds = exports.StatRunes = exports.StatRuneNames = exports.StatRuneIds = exports.RuneNames = exports.RuneIds = exports.ItemNames = exports.ItemKeys = exports.DDPaths = exports.ChampionNames = exports.ChampionKeys = exports.summoner = exports.runesReforged = exports.item = exports.champion = void 0;
20
+ exports.isTreeRuneName = exports.isTreeRuneId = exports.isSummonerSpellName = exports.isSummonerSpellKey = exports.isSummonerSpellId = exports.isStatRuneName = exports.isStatRuneId = exports.isRuneName = exports.isRuneId = exports.isItemName = exports.isItemKey = exports.isChampionName = exports.isChampionKey = exports.getSummonerSpellNameByKey = exports.getSummonerSpellKeyByName = exports.getRuneNameById = exports.getRuneIdByName = exports.getItemNameByKey = exports.getItemKeyByName = exports.getChampionNameByKey = exports.getChampionKeyByName = exports.summonerByName = exports.summonerByKey = exports.runesByName = exports.runesById = exports.itemByName = exports.championByName = exports.championByKey = exports.TreeRuneNames = exports.TreeRuneIds = exports.SummonerSpellNames = exports.SummonerSpellKeys = exports.SummonerSpellIds = exports.StatRunes = exports.StatRuneNames = exports.StatRuneIds = exports.RuneNames = exports.RuneIds = exports.ItemNames = exports.ItemKeys = exports.DDPaths = exports.ChampionNames = exports.ChampionKeys = exports.summoner = exports.runesReforged = exports.item = exports.champion = void 0;
21
21
  const champion_json_1 = __importDefault(require("./assets/champion.json"));
22
22
  const item_json_1 = __importDefault(require("./assets/item.json"));
23
23
  const runesReforged_json_1 = __importDefault(require("./assets/runesReforged.json"));
@@ -70,6 +70,22 @@ exports.runesById = runesById_json_1.default;
70
70
  exports.runesByName = runesByName_json_1.default;
71
71
  exports.summonerByKey = summonerByKey_json_1.default;
72
72
  exports.summonerByName = summonerByName_json_1.default;
73
+ var getChampionKeyByName_1 = require("./Helpers/getChampionKeyByName");
74
+ Object.defineProperty(exports, "getChampionKeyByName", { enumerable: true, get: function () { return getChampionKeyByName_1.getChampionKeyByName; } });
75
+ var getChampionNameByKey_1 = require("./Helpers/getChampionNameByKey");
76
+ Object.defineProperty(exports, "getChampionNameByKey", { enumerable: true, get: function () { return getChampionNameByKey_1.getChampionNameByKey; } });
77
+ var getItemKeyByName_1 = require("./Helpers/getItemKeyByName");
78
+ Object.defineProperty(exports, "getItemKeyByName", { enumerable: true, get: function () { return getItemKeyByName_1.getItemKeyByName; } });
79
+ var getItemNameByKey_1 = require("./Helpers/getItemNameByKey");
80
+ Object.defineProperty(exports, "getItemNameByKey", { enumerable: true, get: function () { return getItemNameByKey_1.getItemNameByKey; } });
81
+ var getRuneIdByName_1 = require("./Helpers/getRuneIdByName");
82
+ Object.defineProperty(exports, "getRuneIdByName", { enumerable: true, get: function () { return getRuneIdByName_1.getRuneIdByName; } });
83
+ var getRuneNameById_1 = require("./Helpers/getRuneNameById");
84
+ Object.defineProperty(exports, "getRuneNameById", { enumerable: true, get: function () { return getRuneNameById_1.getRuneNameById; } });
85
+ var getSummonerSpellKeyByName_1 = require("./Helpers/getSummonerSpellKeyByName");
86
+ Object.defineProperty(exports, "getSummonerSpellKeyByName", { enumerable: true, get: function () { return getSummonerSpellKeyByName_1.getSummonerSpellKeyByName; } });
87
+ var getSummonerSpellNameByKey_1 = require("./Helpers/getSummonerSpellNameByKey");
88
+ Object.defineProperty(exports, "getSummonerSpellNameByKey", { enumerable: true, get: function () { return getSummonerSpellNameByKey_1.getSummonerSpellNameByKey; } });
73
89
  var isChampionKey_1 = require("./Helpers/isChampionKey");
74
90
  Object.defineProperty(exports, "isChampionKey", { enumerable: true, get: function () { return isChampionKey_1.isChampionKey; } });
75
91
  var isChampionName_1 = require("./Helpers/isChampionName");
@@ -82,11 +98,19 @@ var isRuneId_1 = require("./Helpers/isRuneId");
82
98
  Object.defineProperty(exports, "isRuneId", { enumerable: true, get: function () { return isRuneId_1.isRuneId; } });
83
99
  var isRuneName_1 = require("./Helpers/isRuneName");
84
100
  Object.defineProperty(exports, "isRuneName", { enumerable: true, get: function () { return isRuneName_1.isRuneName; } });
101
+ var isStatRuneId_1 = require("./Helpers/isStatRuneId");
102
+ Object.defineProperty(exports, "isStatRuneId", { enumerable: true, get: function () { return isStatRuneId_1.isStatRuneId; } });
103
+ var isStatRuneName_1 = require("./Helpers/isStatRuneName");
104
+ Object.defineProperty(exports, "isStatRuneName", { enumerable: true, get: function () { return isStatRuneName_1.isStatRuneName; } });
85
105
  var isSummonerSpellId_1 = require("./Helpers/isSummonerSpellId");
86
106
  Object.defineProperty(exports, "isSummonerSpellId", { enumerable: true, get: function () { return isSummonerSpellId_1.isSummonerSpellId; } });
87
107
  var isSummonerSpellKey_1 = require("./Helpers/isSummonerSpellKey");
88
108
  Object.defineProperty(exports, "isSummonerSpellKey", { enumerable: true, get: function () { return isSummonerSpellKey_1.isSummonerSpellKey; } });
89
109
  var isSummonerSpellName_1 = require("./Helpers/isSummonerSpellName");
90
110
  Object.defineProperty(exports, "isSummonerSpellName", { enumerable: true, get: function () { return isSummonerSpellName_1.isSummonerSpellName; } });
111
+ var isTreeRuneId_1 = require("./Helpers/isTreeRuneId");
112
+ Object.defineProperty(exports, "isTreeRuneId", { enumerable: true, get: function () { return isTreeRuneId_1.isTreeRuneId; } });
113
+ var isTreeRuneName_1 = require("./Helpers/isTreeRuneName");
114
+ Object.defineProperty(exports, "isTreeRuneName", { enumerable: true, get: function () { return isTreeRuneName_1.isTreeRuneName; } });
91
115
  __exportStar(require("./types"), exports);
92
116
  __exportStar(require("./types/Meta"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lol-constants",
3
- "version": "0.9.0",
3
+ "version": "0.9.2",
4
4
  "description": "League of Legends constants and data resources, such as champion, item, runes reforged, summoner spells.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",