diff options
author | mat-1 <github@matdoes.dev> | 2021-03-01 03:23:15 +0000 |
---|---|---|
committer | mat-1 <github@matdoes.dev> | 2021-03-01 03:23:15 +0000 |
commit | 19a6844cafd84cff79f5df08f7a9f08504f67e70 (patch) | |
tree | 489a57d71df73a90702fb347b594361f6e3c723f | |
parent | 14622b310f170daa7d720da85c65a68dc6784702 (diff) | |
download | skyblock-api-19a6844cafd84cff79f5df08f7a9f08504f67e70.tar.gz skyblock-api-19a6844cafd84cff79f5df08f7a9f08504f67e70.tar.bz2 skyblock-api-19a6844cafd84cff79f5df08f7a9f08504f67e70.zip |
Compiled TS into JS
-rw-r--r-- | build/constants.js | 3 | ||||
-rw-r--r-- | build/database.js | 6 | ||||
-rw-r--r-- | build/index.js | 2 |
3 files changed, 6 insertions, 5 deletions
diff --git a/build/constants.js b/build/constants.js index 8300e52..5e09240 100644 --- a/build/constants.js +++ b/build/constants.js @@ -51,11 +51,12 @@ async function fetchFile(path) { 'Authorization': undefined }); const data = await r.json(); - return { + const file = { path: data.path, content: Buffer.from(data.content, data.encoding).toString(), sha: data.sha }; + fileCache.set(path, file); } /** * Edit a file on skyblock-constants diff --git a/build/database.js b/build/database.js index ca23273..fdcc01b 100644 --- a/build/database.js +++ b/build/database.js @@ -25,7 +25,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.updateDatabaseMember = exports.fetchMemberLeaderboard = exports.fetchAllMemberLeaderboardAttributes = exports.fetchAllLeaderboardsCategoriezed = void 0; +exports.updateDatabaseMember = exports.fetchMemberLeaderboard = exports.fetchAllMemberLeaderboardAttributes = exports.fetchAllLeaderboardsCategorized = void 0; const constants = __importStar(require("./constants")); const cached = __importStar(require("./hypixelCached")); const mongodb_1 = require("mongodb"); @@ -76,7 +76,7 @@ function getMemberLeaderboardAttributes(member) { visited_zones: member.visited_zones.length, }; } -async function fetchAllLeaderboardsCategoriezed() { +async function fetchAllLeaderboardsCategorized() { const memberLeaderboardAttributes = await fetchAllMemberLeaderboardAttributes(); const categorizedLeaderboards = {}; for (const leaderboard of memberLeaderboardAttributes) { @@ -91,7 +91,7 @@ async function fetchAllLeaderboardsCategoriezed() { categorizedLeaderboards.misc = misc; return categorizedLeaderboards; } -exports.fetchAllLeaderboardsCategoriezed = fetchAllLeaderboardsCategoriezed; +exports.fetchAllLeaderboardsCategorized = fetchAllLeaderboardsCategorized; /** Fetch the names of all the leaderboards */ async function fetchAllMemberLeaderboardAttributes() { return [ diff --git a/build/index.js b/build/index.js index 0d8bd70..e6d0ff3 100644 --- a/build/index.js +++ b/build/index.js @@ -29,6 +29,6 @@ app.get('/leaderboard/:name', async (req, res) => { res.json(await database_1.fetchMemberLeaderboard(req.params.name)); }); app.get('/leaderboards', async (req, res) => { - res.json(await database_1.fetchAllLeaderboardsCategoriezed()); + res.json(await database_1.fetchAllLeaderboardsCategorized()); }); app.listen(8080, () => console.log('App started :)')); |