lol-constants 0.2.1 → 0.5.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.
@@ -0,0 +1 @@
1
+ export declare function generateItemsByName(): void;
@@ -0,0 +1,25 @@
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.generateItemsByName = void 0;
7
+ const fs_1 = __importDefault(require("fs"));
8
+ const item_json_1 = __importDefault(require("../assets/item.json"));
9
+ function generateItemsByName() {
10
+ const itemsByKey = {
11
+ data: {},
12
+ version: '',
13
+ };
14
+ let itemKey;
15
+ for (itemKey in item_json_1.default.data) {
16
+ const itemData = item_json_1.default.data[itemKey];
17
+ itemsByKey.data[itemData.name] = {
18
+ ...itemData,
19
+ key: itemKey,
20
+ };
21
+ }
22
+ itemsByKey.version = item_json_1.default.version;
23
+ fs_1.default.writeFileSync(`src/generated/itemByKey.json`, JSON.stringify(itemsByKey));
24
+ }
25
+ exports.generateItemsByName = generateItemsByName;