lol-constants 2.1.0 → 2.2.0

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.
Files changed (130) hide show
  1. package/assets/scripts/constants/RuneIdComment.d.ts +1 -0
  2. package/assets/scripts/constants/RuneIdComment.js +19 -0
  3. package/assets/scripts/generate-all.d.ts +6 -0
  4. package/assets/scripts/generate-all.js +10 -0
  5. package/assets/scripts/generate-categorized-item-keys-num.d.ts +1 -0
  6. package/assets/scripts/generate-categorized-item-keys-num.js +60 -0
  7. package/assets/scripts/generate-categorized-item-keys.js +7 -1
  8. package/assets/scripts/generate-categorized-item-names.js +3 -1
  9. package/assets/scripts/generate-champion-ids-by-name.js +5 -3
  10. package/assets/scripts/generate-champion-ids.js +6 -3
  11. package/assets/scripts/generate-champion-keys-num.d.ts +1 -0
  12. package/assets/scripts/generate-champion-keys-num.js +22 -0
  13. package/assets/scripts/generate-champion-keys.js +6 -3
  14. package/assets/scripts/generate-champion-names.js +6 -3
  15. package/assets/scripts/generate-item-keys-num.d.ts +1 -0
  16. package/assets/scripts/generate-item-keys-num.js +23 -0
  17. package/assets/scripts/generate-item-keys.js +6 -3
  18. package/assets/scripts/generate-item-names.js +6 -3
  19. package/assets/scripts/generate-rune-ids.js +8 -3
  20. package/assets/scripts/generate-rune-names.js +6 -3
  21. package/assets/scripts/generate-rune-sets-by-rune-names-num.d.ts +1 -0
  22. package/assets/scripts/generate-rune-sets-by-rune-names-num.js +118 -0
  23. package/assets/scripts/generate-rune-sets-by-rune-names.js +5 -0
  24. package/assets/scripts/generate-rune-sets.js +2 -0
  25. package/assets/scripts/generate-spell-ids-by-name.js +5 -3
  26. package/assets/scripts/generate-spell-ids.js +6 -3
  27. package/assets/scripts/generate-spell-keys-num.d.ts +1 -0
  28. package/assets/scripts/generate-spell-keys-num.js +22 -0
  29. package/assets/scripts/generate-spell-keys.js +6 -3
  30. package/assets/scripts/generate-spell-names.js +6 -3
  31. package/assets/scripts/generate-stat-rune-ids.js +8 -3
  32. package/assets/scripts/generate-stat-rune-names.js +8 -5
  33. package/assets/scripts/generate-tree-rune-ids-num.d.ts +1 -0
  34. package/assets/scripts/generate-tree-rune-ids-num.js +23 -0
  35. package/assets/scripts/generate-tree-rune-ids.js +8 -3
  36. package/assets/scripts/generate-tree-rune-names.js +8 -5
  37. package/assets/scripts/helpers/getComment.d.ts +1 -0
  38. package/assets/scripts/helpers/getComment.js +8 -0
  39. package/assets/scripts/helpers/getExportStatement.d.ts +1 -1
  40. package/assets/scripts/helpers/getExportStatement.js +28 -3
  41. package/assets/scripts/helpers/getFmtdComment.js +1 -1
  42. package/assets/scripts/helpers/validateNumber.d.ts +1 -0
  43. package/assets/scripts/helpers/validateNumber.js +10 -0
  44. package/assets/scripts/helpers/writeToTmpFile.d.ts +3 -0
  45. package/assets/scripts/helpers/writeToTmpFile.js +2 -2
  46. package/core/constants/Champions/ChampionIds.d.ts +1 -0
  47. package/core/constants/Champions/ChampionKeys.d.ts +1 -0
  48. package/core/constants/Champions/ChampionKeysNum.d.ts +166 -0
  49. package/core/constants/Champions/ChampionKeysNum.js +4 -0
  50. package/core/constants/Champions/ChampionNames.d.ts +1 -0
  51. package/core/constants/Items/BootsItemKeys.d.ts +1 -0
  52. package/core/constants/Items/BootsItemKeysNum.d.ts +12 -0
  53. package/core/constants/Items/BootsItemKeysNum.js +4 -0
  54. package/core/constants/Items/BootsItemNames.d.ts +1 -0
  55. package/core/constants/Items/ItemKeys.d.ts +1 -0
  56. package/core/constants/Items/ItemKeysNum.d.ts +264 -0
  57. package/core/constants/Items/ItemKeysNum.js +4 -0
  58. package/core/constants/Items/ItemNames.d.ts +1 -0
  59. package/core/constants/Items/LegendaryItemKeys.d.ts +1 -0
  60. package/core/constants/Items/LegendaryItemKeysNum.d.ts +77 -0
  61. package/core/constants/Items/LegendaryItemKeysNum.js +4 -0
  62. package/core/constants/Items/LegendaryItemNames.d.ts +1 -0
  63. package/core/constants/Items/MythicItemKeys.d.ts +1 -0
  64. package/core/constants/Items/MythicItemKeysNum.d.ts +31 -0
  65. package/core/constants/Items/MythicItemKeysNum.js +4 -0
  66. package/core/constants/Items/MythicItemNames.d.ts +1 -0
  67. package/core/constants/Runes/RuneIconFileNames.d.ts +1 -1
  68. package/core/constants/Runes/RuneSets.d.ts +2 -0
  69. package/core/constants/Runes/RuneSetsByRuneNames.d.ts +30 -0
  70. package/core/constants/Runes/RuneSetsByRuneNamesNum.d.ts +743 -0
  71. package/core/constants/Runes/RuneSetsByRuneNamesNum.js +14 -0
  72. package/core/constants/Runes/RuneTreeIds.d.ts +1 -1
  73. package/core/constants/Runes/RuneTreeIds.js +1 -1
  74. package/core/constants/Runes/RuneTreeIdsNum.d.ts +11 -0
  75. package/core/constants/Runes/RuneTreeIdsNum.js +19 -0
  76. package/core/constants/Runes/TreeRuneIds.d.ts +15 -0
  77. package/core/constants/Runes/TreeRuneIdsNum.d.ts +66 -0
  78. package/core/constants/Runes/TreeRuneIdsNum.js +4 -0
  79. package/core/constants/Runes/TreeRuneNames.d.ts +1 -0
  80. package/core/constants/Spells/SpellIds.d.ts +1 -0
  81. package/core/constants/Spells/SpellKeys.d.ts +1 -0
  82. package/core/constants/Spells/SpellKeysNum.d.ts +19 -0
  83. package/core/constants/Spells/SpellKeysNum.js +4 -0
  84. package/core/constants/Spells/SpellNames.d.ts +1 -0
  85. package/core/helpers/Champions/getChampionIdByKey.d.ts +2 -1
  86. package/core/helpers/Champions/getChampionIdByName.d.ts +2 -1
  87. package/core/helpers/Champions/getChampionKeyById.d.ts +2 -1
  88. package/core/helpers/Champions/getChampionKeyByName.d.ts +2 -1
  89. package/core/helpers/Champions/getChampionNameById.d.ts +2 -1
  90. package/core/helpers/Champions/getChampionNameByKey.d.ts +2 -1
  91. package/core/helpers/Champions/isChampionId.d.ts +1 -1
  92. package/core/helpers/Champions/isChampionKey.d.ts +1 -1
  93. package/core/helpers/Champions/isChampionName.d.ts +1 -1
  94. package/core/helpers/Items/getItemKeyByName.d.ts +2 -1
  95. package/core/helpers/Items/getItemNameByKey.d.ts +2 -1
  96. package/core/helpers/Items/isBootsItemKey.d.ts +1 -1
  97. package/core/helpers/Items/isBootsItemName.d.ts +1 -1
  98. package/core/helpers/Items/isItemKey.d.ts +1 -1
  99. package/core/helpers/Items/isItemName.d.ts +1 -1
  100. package/core/helpers/Items/isLegendaryItemKey.d.ts +1 -1
  101. package/core/helpers/Items/isLegendaryItemName.d.ts +1 -1
  102. package/core/helpers/Items/isMythicItemKey.d.ts +1 -1
  103. package/core/helpers/Items/isMythicItemName.d.ts +1 -1
  104. package/core/helpers/Runes/getRuneCategoryName.d.ts +2 -1
  105. package/core/helpers/Runes/getRuneCdnUrl.d.ts +1 -1
  106. package/core/helpers/Runes/getRuneIdByName.d.ts +2 -1
  107. package/core/helpers/Runes/getRuneNameById.d.ts +2 -1
  108. package/core/helpers/Runes/getStatRuneIdByName.d.ts +2 -1
  109. package/core/helpers/Runes/getStatRuneNameById.d.ts +2 -1
  110. package/core/helpers/Runes/getTreeRuneIdByName.d.ts +2 -1
  111. package/core/helpers/Runes/getTreeRuneNameById.d.ts +2 -1
  112. package/core/helpers/Runes/isRuneId.d.ts +1 -1
  113. package/core/helpers/Runes/isRuneName.d.ts +1 -1
  114. package/core/helpers/Runes/isStatRuneId.d.ts +1 -1
  115. package/core/helpers/Runes/isStatRuneName.d.ts +1 -1
  116. package/core/helpers/Runes/isTreeRuneId.d.ts +1 -1
  117. package/core/helpers/Runes/isTreeRuneName.d.ts +1 -1
  118. package/core/helpers/Spells/getSpellIdByKey.d.ts +2 -1
  119. package/core/helpers/Spells/getSpellIdByName.d.ts +2 -1
  120. package/core/helpers/Spells/getSpellKeyById.d.ts +2 -1
  121. package/core/helpers/Spells/getSpellKeyByName.d.ts +2 -1
  122. package/core/helpers/Spells/getSpellNameById.d.ts +2 -1
  123. package/core/helpers/Spells/getSpellNameByKey.d.ts +2 -1
  124. package/core/helpers/Spells/isSpellId.d.ts +1 -1
  125. package/core/helpers/Spells/isSpellKey.d.ts +1 -1
  126. package/core/helpers/Spells/isSpellName.d.ts +1 -1
  127. package/core/index.d.ts +9 -0
  128. package/core/index.js +9 -12
  129. package/core/types/types.d.ts +27 -86
  130. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ export declare const RuneIdComment: "\n/**\n * There are 3 main Rune ID types:\n * - `RuneId` (all),\n * - `TreeRuneId` (all but stat runes),\n * - `StatRuneId` (only stat runes).\n * \n * There are 6 more specific Rune ID types as well:\n * - `KeystoneRuneId`,\n * - `PrecisionTreeRuneId`,\n * - `DominationTreeRuneId`,\n * - `SorceryTreeRuneId`,\n * - `ResolveTreeRuneId`,\n * - `InspirationTreeRuneId`.\n */\n";
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RuneIdComment = void 0;
4
+ exports.RuneIdComment = `
5
+ /**
6
+ * There are 3 main Rune ID types:
7
+ * - \`RuneId\` (all),
8
+ * - \`TreeRuneId\` (all but stat runes),
9
+ * - \`StatRuneId\` (only stat runes).
10
+ *
11
+ * There are 6 more specific Rune ID types as well:
12
+ * - \`KeystoneRuneId\`,
13
+ * - \`PrecisionTreeRuneId\`,
14
+ * - \`DominationTreeRuneId\`,
15
+ * - \`SorceryTreeRuneId\`,
16
+ * - \`ResolveTreeRuneId\`,
17
+ * - \`InspirationTreeRuneId\`.
18
+ */
19
+ `;
@@ -1,17 +1,23 @@
1
+ import './generate-categorized-item-keys-num';
1
2
  import './generate-categorized-item-keys';
2
3
  import './generate-categorized-item-names';
3
4
  import './generate-champion-ids-by-name';
4
5
  import './generate-champion-ids';
6
+ import './generate-champion-keys-num';
5
7
  import './generate-champion-keys';
6
8
  import './generate-champion-names';
9
+ import './generate-item-keys-num';
7
10
  import './generate-item-keys';
8
11
  import './generate-item-names';
9
12
  import './generate-rune-picking-relationships';
13
+ import './generate-rune-sets-by-rune-names-num';
10
14
  import './generate-rune-sets-by-rune-names';
11
15
  import './generate-rune-sets';
12
16
  import './generate-spell-ids-by-name';
13
17
  import './generate-spell-ids';
18
+ import './generate-spell-keys-num';
14
19
  import './generate-spell-keys';
15
20
  import './generate-spell-names';
21
+ import './generate-tree-rune-ids-num';
16
22
  import './generate-tree-rune-ids';
17
23
  import './generate-tree-rune-names';
@@ -1,19 +1,29 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ require("./generate-categorized-item-keys-num");
3
4
  require("./generate-categorized-item-keys");
4
5
  require("./generate-categorized-item-names");
5
6
  require("./generate-champion-ids-by-name");
6
7
  require("./generate-champion-ids");
8
+ require("./generate-champion-keys-num");
7
9
  require("./generate-champion-keys");
8
10
  require("./generate-champion-names");
11
+ require("./generate-item-keys-num");
9
12
  require("./generate-item-keys");
10
13
  require("./generate-item-names");
14
+ // import './generate-rune-ids'
15
+ // import './generate-rune-names'
11
16
  require("./generate-rune-picking-relationships");
17
+ require("./generate-rune-sets-by-rune-names-num");
12
18
  require("./generate-rune-sets-by-rune-names");
13
19
  require("./generate-rune-sets");
14
20
  require("./generate-spell-ids-by-name");
15
21
  require("./generate-spell-ids");
22
+ require("./generate-spell-keys-num");
16
23
  require("./generate-spell-keys");
17
24
  require("./generate-spell-names");
25
+ // import './generate-stat-rune-ids'
26
+ // import './generate-stat-rune-names'
27
+ require("./generate-tree-rune-ids-num");
18
28
  require("./generate-tree-rune-ids");
19
29
  require("./generate-tree-rune-names");
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const BootsItemNames_1 = require("../constants/BootsItemNames");
4
+ const Item_1 = require("../constants/Item");
5
+ const LegendaryItemNames_1 = require("../constants/LegendaryItemNames");
6
+ const MythicItemNames_1 = require("../constants/MythicItemNames");
7
+ const validateNumber_1 = require("./helpers/validateNumber");
8
+ const writeToTmpFile_1 = require("./helpers/writeToTmpFile");
9
+ (async () => {
10
+ const itemKeys = {
11
+ mythic: {},
12
+ legendary: {},
13
+ boots: {},
14
+ };
15
+ // Add Mythic Items
16
+ for (const mythicItemName of MythicItemNames_1.MythicItemNames) {
17
+ let itemKey;
18
+ for (itemKey in Item_1.Item.data) {
19
+ const itemData = Item_1.Item.data[itemKey];
20
+ if (itemData.name == mythicItemName) {
21
+ itemKeys.mythic[itemData.name] = (0, validateNumber_1.validateNumber)(itemKey, 'mythic-itemKey');
22
+ }
23
+ }
24
+ }
25
+ // Add Legendary Items
26
+ for (const itemName of LegendaryItemNames_1.LegendaryItemNames) {
27
+ let itemKey;
28
+ for (itemKey in Item_1.Item.data) {
29
+ const itemData = Item_1.Item.data[itemKey];
30
+ if (itemData.name == itemName) {
31
+ itemKeys.legendary[itemData.name] = (0, validateNumber_1.validateNumber)(itemKey, 'legendary-itemKey');
32
+ }
33
+ }
34
+ }
35
+ // Add Boots
36
+ for (const itemName of BootsItemNames_1.BootsItemNames) {
37
+ let itemKey;
38
+ for (itemKey in Item_1.Item.data) {
39
+ const itemData = Item_1.Item.data[itemKey];
40
+ if (itemData.name == itemName) {
41
+ itemKeys.boots[itemData.name] = (0, validateNumber_1.validateNumber)(itemKey, 'boots-itemKey');
42
+ }
43
+ }
44
+ }
45
+ (0, writeToTmpFile_1.writeToTmpFile)('MythicItemKeysNum', {
46
+ constName: 'MythicItemKeysNum',
47
+ typeName: 'MythicItemKeyNum',
48
+ json: itemKeys.mythic,
49
+ });
50
+ (0, writeToTmpFile_1.writeToTmpFile)('LegendaryItemKeysNum', {
51
+ constName: 'LegendaryItemKeysNum',
52
+ typeName: 'LegendaryItemKeyNum',
53
+ json: itemKeys.legendary,
54
+ });
55
+ (0, writeToTmpFile_1.writeToTmpFile)('BootsItemKeysNum', {
56
+ constName: 'BootsItemKeysNum',
57
+ typeName: 'BootsItemKeyNum',
58
+ json: itemKeys.boots,
59
+ });
60
+ })();
@@ -43,15 +43,21 @@ const writeToTmpFile_1 = require("./helpers/writeToTmpFile");
43
43
  }
44
44
  (0, writeToTmpFile_1.writeToTmpFile)('MythicItemKeys', {
45
45
  constName: 'MythicItemKeys',
46
+ includeAutoTypeName: true,
46
47
  json: itemKeys.mythic,
47
48
  });
48
49
  (0, writeToTmpFile_1.writeToTmpFile)('LegendaryItemKeys', {
49
50
  constName: 'LegendaryItemKeys',
51
+ includeAutoTypeName: true,
50
52
  json: itemKeys.legendary,
51
53
  });
52
54
  (0, writeToTmpFile_1.writeToTmpFile)('BootsItemKeys', {
53
55
  constName: 'BootsItemKeys',
56
+ includeAutoTypeName: true,
54
57
  json: itemKeys.boots,
55
58
  });
56
- console.log(`\n--= Categorized Item Keys =--`, `\ngenerated:`, `\n Mythic Items: ${Object.values(itemKeys.mythic).length}`, `\n Legendary Items: ${Object.values(itemKeys.legendary).length}`, `\n Boots Items: ${Object.values(itemKeys.boots).length}`, `\n`);
59
+ let m = Object.values(itemKeys.mythic).length;
60
+ let l = Object.values(itemKeys.legendary).length;
61
+ let b = Object.values(itemKeys.boots).length;
62
+ console.log(`\ncategorized items`, `\n Mythic Items: ${m}`, `\n Legendary Items: ${l}`, `\n Boots Items: ${b}`, `\n All: ${m + l + b}`, `\n`);
57
63
  })();
@@ -43,15 +43,17 @@ const writeToTmpFile_1 = require("./helpers/writeToTmpFile");
43
43
  }
44
44
  (0, writeToTmpFile_1.writeToTmpFile)('MythicItemNames', {
45
45
  constName: 'MythicItemNames',
46
+ includeAutoTypeName: true,
46
47
  json: itemNames.mythic,
47
48
  });
48
49
  (0, writeToTmpFile_1.writeToTmpFile)('LegendaryItemNames', {
49
50
  constName: 'LegendaryItemNames',
51
+ includeAutoTypeName: true,
50
52
  json: itemNames.legendary,
51
53
  });
52
54
  (0, writeToTmpFile_1.writeToTmpFile)('BootsItemNames', {
53
55
  constName: 'BootsItemNames',
56
+ includeAutoTypeName: true,
54
57
  json: itemNames.boots,
55
58
  });
56
- console.log(`\n--= Categorized Item Names =--`, `\ngenerated:`, `\n Mythic Items: ${Object.values(itemNames.mythic).length}`, `\n Legendary Items: ${Object.values(itemNames.legendary).length}`, `\n Boots Items: ${Object.values(itemNames.boots).length}`, `\n`);
57
59
  })();
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const fs_1 = require("fs");
4
3
  const Champion_1 = require("../constants/Champion");
5
- const getExportStatement_1 = require("./helpers/getExportStatement");
4
+ const writeToTmpFile_1 = require("./helpers/writeToTmpFile");
6
5
  (async () => {
7
6
  const championIds = {};
8
7
  // Extract all Champion IDs
@@ -13,5 +12,8 @@ const getExportStatement_1 = require("./helpers/getExportStatement");
13
12
  }
14
13
  // Write to tmp file
15
14
  const constName = 'ChampionIdsByName';
16
- (0, fs_1.writeFileSync)(`tmp/${constName}.ts`, (0, getExportStatement_1.getExportStatement)(constName, championIds));
15
+ (0, writeToTmpFile_1.writeToTmpFile)(constName, {
16
+ constName,
17
+ json: championIds,
18
+ });
17
19
  })();
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const fs_1 = require("fs");
4
3
  const Champion_1 = require("../constants/Champion");
5
- const getExportStatement_1 = require("./helpers/getExportStatement");
4
+ const writeToTmpFile_1 = require("./helpers/writeToTmpFile");
6
5
  (async () => {
7
6
  const championIds = {};
8
7
  // Extract all Champion IDs
@@ -13,5 +12,9 @@ const getExportStatement_1 = require("./helpers/getExportStatement");
13
12
  }
14
13
  // Write to tmp file
15
14
  const constName = 'ChampionIds';
16
- (0, fs_1.writeFileSync)(`tmp/${constName}.ts`, (0, getExportStatement_1.getExportStatement)(constName, championIds));
15
+ (0, writeToTmpFile_1.writeToTmpFile)(constName, {
16
+ constName,
17
+ includeAutoTypeName: true,
18
+ json: championIds,
19
+ });
17
20
  })();
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const Champion_1 = require("../constants/Champion");
4
+ const validateNumber_1 = require("./helpers/validateNumber");
5
+ const writeToTmpFile_1 = require("./helpers/writeToTmpFile");
6
+ (async () => {
7
+ const championKeys = {};
8
+ // Add all champions' data to each corresponding key value
9
+ let championId;
10
+ for (championId in Champion_1.Champion.data) {
11
+ const championData = Champion_1.Champion.data[championId];
12
+ championKeys[championId] = (0, validateNumber_1.validateNumber)(championData.key, 'championKey');
13
+ }
14
+ // Write to file
15
+ const constName = 'ChampionKeysNum';
16
+ const typeName = 'ChampionKeyNum';
17
+ (0, writeToTmpFile_1.writeToTmpFile)(constName, {
18
+ constName,
19
+ typeName,
20
+ json: championKeys,
21
+ });
22
+ })();
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const fs_1 = require("fs");
4
3
  const Champion_1 = require("../constants/Champion");
5
- const getExportStatement_1 = require("./helpers/getExportStatement");
4
+ const writeToTmpFile_1 = require("./helpers/writeToTmpFile");
6
5
  (async () => {
7
6
  const championKeys = {};
8
7
  // Add all champions' data to each corresponding key value
@@ -13,5 +12,9 @@ const getExportStatement_1 = require("./helpers/getExportStatement");
13
12
  }
14
13
  // Write to file
15
14
  const constName = 'ChampionKeys';
16
- (0, fs_1.writeFileSync)(`tmp/${constName}.ts`, (0, getExportStatement_1.getExportStatement)(constName, championKeys));
15
+ (0, writeToTmpFile_1.writeToTmpFile)(constName, {
16
+ constName,
17
+ includeAutoTypeName: true,
18
+ json: championKeys,
19
+ });
17
20
  })();
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const fs_1 = require("fs");
4
3
  const Champion_1 = require("../constants/Champion");
5
- const getExportStatement_1 = require("./helpers/getExportStatement");
4
+ const writeToTmpFile_1 = require("./helpers/writeToTmpFile");
6
5
  (async () => {
7
6
  const championNames = {};
8
7
  // Extract all champion names from `champion.json`
@@ -13,5 +12,9 @@ const getExportStatement_1 = require("./helpers/getExportStatement");
13
12
  }
14
13
  // Write to file
15
14
  const constName = 'ChampionNames';
16
- (0, fs_1.writeFileSync)(`tmp/${constName}.ts`, (0, getExportStatement_1.getExportStatement)(constName, championNames));
15
+ (0, writeToTmpFile_1.writeToTmpFile)(constName, {
16
+ constName,
17
+ includeAutoTypeName: true,
18
+ json: championNames,
19
+ });
17
20
  })();
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const Item_1 = require("../constants/Item");
4
+ const validateNumber_1 = require("./helpers/validateNumber");
5
+ const writeToTmpFile_1 = require("./helpers/writeToTmpFile");
6
+ (async () => {
7
+ const itemKeys = {};
8
+ // Add all items' data to each corresponding name value
9
+ let itemKey;
10
+ for (itemKey in Item_1.Item.data) {
11
+ const itemData = Item_1.Item.data[itemKey];
12
+ let htmlEscapedName = itemData.name.replace(/<[^>]*>?/gm, '');
13
+ itemKeys[htmlEscapedName] = (0, validateNumber_1.validateNumber)(itemKey, 'itemKey');
14
+ }
15
+ // Write to file
16
+ const constName = 'ItemKeysNum';
17
+ const typeName = 'ItemKeyNum';
18
+ (0, writeToTmpFile_1.writeToTmpFile)(constName, {
19
+ constName,
20
+ typeName,
21
+ json: itemKeys,
22
+ });
23
+ })();
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const fs_1 = require("fs");
4
3
  const Item_1 = require("../constants/Item");
5
- const getExportStatement_1 = require("./helpers/getExportStatement");
4
+ const writeToTmpFile_1 = require("./helpers/writeToTmpFile");
6
5
  (async () => {
7
6
  const itemKeys = {};
8
7
  // Add all items' data to each corresponding name value
@@ -14,5 +13,9 @@ const getExportStatement_1 = require("./helpers/getExportStatement");
14
13
  }
15
14
  // Write to file
16
15
  const constName = 'ItemKeys';
17
- (0, fs_1.writeFileSync)(`tmp/${constName}.ts`, (0, getExportStatement_1.getExportStatement)(constName, itemKeys));
16
+ (0, writeToTmpFile_1.writeToTmpFile)(constName, {
17
+ constName,
18
+ includeAutoTypeName: true,
19
+ json: itemKeys,
20
+ });
18
21
  })();
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const fs_1 = require("fs");
4
3
  const Item_1 = require("../constants/Item");
5
- const getExportStatement_1 = require("./helpers/getExportStatement");
4
+ const writeToTmpFile_1 = require("./helpers/writeToTmpFile");
6
5
  (async () => {
7
6
  const itemNames = {};
8
7
  // Add all items' data to each corresponding name value
@@ -14,5 +13,9 @@ const getExportStatement_1 = require("./helpers/getExportStatement");
14
13
  }
15
14
  // Write to file
16
15
  const constName = 'ItemNames';
17
- (0, fs_1.writeFileSync)(`tmp/${constName}.ts`, (0, getExportStatement_1.getExportStatement)(constName, itemNames));
16
+ (0, writeToTmpFile_1.writeToTmpFile)(constName, {
17
+ constName,
18
+ includeAutoTypeName: true,
19
+ json: itemNames,
20
+ });
18
21
  })();
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const fs_1 = require("fs");
4
3
  const RunesReforged_1 = require("../constants/RunesReforged");
5
4
  const StatRunes_1 = require("../constants/StatRunes");
6
- const getExportStatement_1 = require("./helpers/getExportStatement");
5
+ const RuneIdComment_1 = require("./constants/RuneIdComment");
6
+ const writeToTmpFile_1 = require("./helpers/writeToTmpFile");
7
7
  (async () => {
8
8
  const runeIds = {};
9
9
  // Construct the new data and assign it to product object
@@ -22,5 +22,10 @@ const getExportStatement_1 = require("./helpers/getExportStatement");
22
22
  }
23
23
  // Write to file
24
24
  const constName = 'RuneIds';
25
- (0, fs_1.writeFileSync)(`tmp/${constName}.ts`, (0, getExportStatement_1.getExportStatement)(constName, runeIds));
25
+ (0, writeToTmpFile_1.writeToTmpFile)(constName, {
26
+ constName,
27
+ includeAutoTypeName: true,
28
+ typeComment: RuneIdComment_1.RuneIdComment,
29
+ json: runeIds,
30
+ });
26
31
  })();
@@ -1,9 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const fs_1 = require("fs");
4
3
  const RunesReforged_1 = require("../constants/RunesReforged");
5
4
  const StatRunes_1 = require("../constants/StatRunes");
6
- const getExportStatement_1 = require("./helpers/getExportStatement");
5
+ const writeToTmpFile_1 = require("./helpers/writeToTmpFile");
7
6
  (async () => {
8
7
  const runeNames = {};
9
8
  // Construct the new data and assign it to product object
@@ -22,5 +21,9 @@ const getExportStatement_1 = require("./helpers/getExportStatement");
22
21
  }
23
22
  // Write to file
24
23
  const constName = 'RuneNames';
25
- (0, fs_1.writeFileSync)(`tmp/${constName}.ts`, (0, getExportStatement_1.getExportStatement)(constName, runeNames));
24
+ (0, writeToTmpFile_1.writeToTmpFile)(constName, {
25
+ constName,
26
+ includeAutoTypeName: true,
27
+ json: runeNames,
28
+ });
26
29
  })();
@@ -0,0 +1,118 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const RunesReforged_1 = require("../constants/RunesReforged");
4
+ const StatRunesByRow_1 = require("../constants/StatRunesByRow");
5
+ const validateNumber_1 = require("./helpers/validateNumber");
6
+ const writeToTmpFile_1 = require("./helpers/writeToTmpFile");
7
+ (async () => {
8
+ const constant = 'RuneSetsByRuneNamesNum';
9
+ const runeSets = {
10
+ PrimaryRuneTrees: {},
11
+ SecondaryRuneTrees: {},
12
+ KeystoneIds: {},
13
+ StatRuneIds: {},
14
+ RuneTreeHSets: {},
15
+ StatRuneHSets: {},
16
+ };
17
+ const keystoneHSetIdx = 0;
18
+ let totalRuneAmt = 0;
19
+ for (const runeTree of RunesReforged_1.RunesReforged) {
20
+ const runeTreeName = runeTree.name;
21
+ const horizontalSets = runeTree.slots;
22
+ let currentHSetIdx = 0;
23
+ for (const { runes, } of horizontalSets) {
24
+ for (let { id, name: runeName, } of runes) {
25
+ totalRuneAmt += 1;
26
+ // Add to PrimaryRuneTrees
27
+ if (!(runeTreeName in runeSets.PrimaryRuneTrees))
28
+ runeSets.PrimaryRuneTrees[runeTreeName] = {};
29
+ runeSets.PrimaryRuneTrees[runeTreeName][runeName] = id;
30
+ // Add to SecondaryRuneTrees
31
+ if (!(runeTreeName in runeSets.SecondaryRuneTrees))
32
+ runeSets.SecondaryRuneTrees[runeTreeName] = {};
33
+ // But only if it isn't a keystone rune
34
+ if (currentHSetIdx != keystoneHSetIdx) {
35
+ runeSets.SecondaryRuneTrees[runeTreeName][runeName] = id;
36
+ }
37
+ // Add to KeystoneIds
38
+ // But only if it is a keystone rune
39
+ if (currentHSetIdx == keystoneHSetIdx) {
40
+ runeSets.KeystoneIds[runeName] = id;
41
+ }
42
+ // Add to RuneTreeHSets
43
+ if (!(runeTreeName in runeSets.RuneTreeHSets))
44
+ runeSets.RuneTreeHSets[runeTreeName] = {};
45
+ if (!runeSets.RuneTreeHSets[runeTreeName][currentHSetIdx])
46
+ runeSets.RuneTreeHSets[runeTreeName][currentHSetIdx] = {};
47
+ runeSets.RuneTreeHSets[runeTreeName][currentHSetIdx][runeName] = id;
48
+ }
49
+ ++currentHSetIdx;
50
+ }
51
+ }
52
+ for (let hSetIdx in StatRunesByRow_1.StatRunesByRow) {
53
+ const hSetRunes = StatRunesByRow_1.StatRunesByRow[hSetIdx];
54
+ for (let [statRuneId, statRuneName] of Object.entries(hSetRunes)) {
55
+ let statRuneIdNum = (0, validateNumber_1.validateNumber)(statRuneId, 'statRuneId');
56
+ // Keep track
57
+ totalRuneAmt += 1;
58
+ // Add to StatRuneIds
59
+ runeSets.StatRuneIds[statRuneName] = statRuneIdNum;
60
+ // Add to StatRuneHSets
61
+ if (!(hSetIdx in runeSets.StatRuneHSets))
62
+ runeSets.StatRuneHSets[hSetIdx] = {};
63
+ runeSets.StatRuneHSets[hSetIdx][statRuneName] = statRuneIdNum;
64
+ }
65
+ }
66
+ // Write to file
67
+ await (0, writeToTmpFile_1.writeToTmpFile)(constant, {
68
+ constName: 'PrimaryRuneTreesByRuneNamesNum',
69
+ json: runeSets.PrimaryRuneTrees,
70
+ }, {
71
+ constName: 'SecondaryRuneTreesByRuneNamesNum',
72
+ json: runeSets.SecondaryRuneTrees,
73
+ }, {
74
+ constName: 'KeystoneIdsNum',
75
+ json: runeSets.KeystoneIds,
76
+ }, {
77
+ constName: 'StatRuneIdsNum',
78
+ json: runeSets.StatRuneIds,
79
+ }, {
80
+ constName: 'RuneIdsNum',
81
+ json: {
82
+ 1: '...PrimaryRuneTreesByRuneNamesNum.Precision',
83
+ 2: '...PrimaryRuneTreesByRuneNamesNum.Domination',
84
+ 3: '...PrimaryRuneTreesByRuneNamesNum.Sorcery',
85
+ 4: '...PrimaryRuneTreesByRuneNamesNum.Resolve',
86
+ 5: '...PrimaryRuneTreesByRuneNamesNum.Inspiration',
87
+ 6: '...StatRuneIdsNum',
88
+ },
89
+ keysToEscape: [1, 2, 3, 4, 5, 6],
90
+ }, {
91
+ constName: 'RuneTreeHSetsByRuneNamesNum',
92
+ json: runeSets.RuneTreeHSets,
93
+ }, {
94
+ constName: 'StatRuneHSetsByRuneNamesNum',
95
+ json: runeSets.StatRuneHSets,
96
+ }, {
97
+ constName: constant,
98
+ comment: `Contains all Rune IDs that are known to man in the game of League of Legends. Sorted by various useful categories. There are a total of ${totalRuneAmt} runes in the game.`,
99
+ json: {
100
+ 'PrimaryRuneTreesByRuneNamesNum': 'PrimaryRuneTreesByRuneNamesNum',
101
+ 'SecondaryRuneTreesByRuneNamesNum': 'SecondaryRuneTreesByRuneNamesNum',
102
+ 'KeystoneIdsNum': 'KeystoneIdsNum',
103
+ 'StatRuneIdsNum': 'StatRuneIdsNum',
104
+ 'RuneIdsNum': 'RuneIdsNum',
105
+ 'RuneTreeHSetsByRuneNamesNum': 'RuneTreeHSetsByRuneNamesNum',
106
+ 'StatRuneHSetsByRuneNamesNum': 'StatRuneHSetsByRuneNamesNum',
107
+ },
108
+ keysToEscape: [
109
+ 'PrimaryRuneTreesByRuneNamesNum',
110
+ 'SecondaryRuneTreesByRuneNamesNum',
111
+ 'KeystoneIdsNum',
112
+ 'StatRuneIdsNum',
113
+ 'RuneIdsNum',
114
+ 'RuneTreeHSetsByRuneNamesNum',
115
+ 'StatRuneHSetsByRuneNamesNum',
116
+ ],
117
+ });
118
+ })();
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const RunesReforged_1 = require("../constants/RunesReforged");
4
4
  const StatRunesByRow_1 = require("../constants/StatRunesByRow");
5
+ const RuneIdComment_1 = require("./constants/RuneIdComment");
5
6
  const writeToTmpFile_1 = require("./helpers/writeToTmpFile");
6
7
  (async () => {
7
8
  const constant = 'RuneSetsByRuneNames';
@@ -73,9 +74,13 @@ const writeToTmpFile_1 = require("./helpers/writeToTmpFile");
73
74
  json: runeSets.KeystoneIds,
74
75
  }, {
75
76
  constName: 'StatRuneIds',
77
+ includeAutoTypeName: true,
78
+ typeComment: RuneIdComment_1.RuneIdComment,
76
79
  json: runeSets.StatRuneIds,
77
80
  }, {
78
81
  constName: 'RuneIds',
82
+ includeAutoTypeName: true,
83
+ typeComment: RuneIdComment_1.RuneIdComment,
79
84
  json: {
80
85
  1: '...PrimaryRuneTreesByRuneNames.Precision',
81
86
  2: '...PrimaryRuneTreesByRuneNames.Domination',
@@ -73,9 +73,11 @@ const writeToTmpFile_1 = require("./helpers/writeToTmpFile");
73
73
  json: runeSets.KeystoneNames,
74
74
  }, {
75
75
  constName: 'StatRuneNames',
76
+ includeAutoTypeName: true,
76
77
  json: runeSets.StatRuneNames,
77
78
  }, {
78
79
  constName: 'RuneNames',
80
+ includeAutoTypeName: true,
79
81
  json: {
80
82
  1: '...PrimaryRuneTrees.Precision',
81
83
  2: '...PrimaryRuneTrees.Domination',
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const fs_1 = require("fs");
4
3
  const Summoner_1 = require("../constants/Summoner");
5
- const getExportStatement_1 = require("./helpers/getExportStatement");
4
+ const writeToTmpFile_1 = require("./helpers/writeToTmpFile");
6
5
  (async () => {
7
6
  const spellIds = {};
8
7
  // Add all summoners spell data to each corresponding key value
@@ -13,5 +12,8 @@ const getExportStatement_1 = require("./helpers/getExportStatement");
13
12
  }
14
13
  // Write to file
15
14
  const constName = 'SpellIdsByName';
16
- (0, fs_1.writeFileSync)(`tmp/${constName}.ts`, (0, getExportStatement_1.getExportStatement)(constName, spellIds));
15
+ (0, writeToTmpFile_1.writeToTmpFile)(constName, {
16
+ constName,
17
+ json: spellIds,
18
+ });
17
19
  })();
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const fs_1 = require("fs");
4
3
  const Summoner_1 = require("../constants/Summoner");
5
- const getExportStatement_1 = require("./helpers/getExportStatement");
4
+ const writeToTmpFile_1 = require("./helpers/writeToTmpFile");
6
5
  (async () => {
7
6
  const spellIds = {};
8
7
  // Add all summoners spell data to each corresponding key value
@@ -13,5 +12,9 @@ const getExportStatement_1 = require("./helpers/getExportStatement");
13
12
  }
14
13
  // Write to file
15
14
  const constName = 'SpellIds';
16
- (0, fs_1.writeFileSync)(`tmp/${constName}.ts`, (0, getExportStatement_1.getExportStatement)(constName, spellIds));
15
+ (0, writeToTmpFile_1.writeToTmpFile)(constName, {
16
+ constName,
17
+ includeAutoTypeName: true,
18
+ json: spellIds,
19
+ });
17
20
  })();
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const Summoner_1 = require("../constants/Summoner");
4
+ const validateNumber_1 = require("./helpers/validateNumber");
5
+ const writeToTmpFile_1 = require("./helpers/writeToTmpFile");
6
+ (async () => {
7
+ const spellKeys = {};
8
+ // Add all summoners spell data to each corresponding key value
9
+ let spellId;
10
+ for (spellId in Summoner_1.Summoner.data) {
11
+ const spellData = Summoner_1.Summoner.data[spellId];
12
+ spellKeys[spellId] = (0, validateNumber_1.validateNumber)(spellData.key, 'spellKey');
13
+ }
14
+ // Write to file
15
+ const constName = 'SpellKeysNum';
16
+ const typeName = 'SpellKeyNum';
17
+ (0, writeToTmpFile_1.writeToTmpFile)(constName, {
18
+ constName,
19
+ typeName,
20
+ json: spellKeys,
21
+ });
22
+ })();