Skip to content

Commit

Permalink
Merge pull request #297 from Solar-Tweaks/master
Browse files Browse the repository at this point in the history
Changed files imports
  • Loading branch information
StavZ authored Jan 7, 2022
2 parents 6903ca2 + 8c70a19 commit aa8a835
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 18 deletions.
32 changes: 23 additions & 9 deletions src/API/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
/* eslint-disable no-extend-native */
const fs = require('fs');
// eslint-disable-next-line no-path-concat
const curDir = __dirname + '/';
module.exports = Array.from(fs.readdirSync(curDir, { withFileTypes: true }))
.filter((x) => x.name !== 'index.js')
.map((x) => x.isDirectory() ? Array.from(fs.readdirSync(curDir + x.name)).map((y) => ([y.split('.')[0], x.name + '/' + y])) : [[x.name.split('.')[0], x.name]])
.flat(1)
.reduce((pV, cV) => Object.assign(pV, { [cV[0]]: require(curDir + cV[1]) }), {});
module.exports = {
getAPIStatus: require('./getAPIStatus'),
getBoosters: require('./getBoosters'),
getFriends: require('./getFriends'),
getGameCounts: require('./getGameCounts'),
getGuild: require('./getGuild'),
getKeyInfo: require('./getKeyInfo'),
getLeaderboards: require('./getLeaderboards'),
getPlayer: require('./getPlayer'),
getRankedSkyWars: require('./getRankedSkyWars'),
getRecentGames: require('./getRecentGames'),
getServerInfo: require('./getServerInfo'),
getStatus: require('./getStatus'),
getWatchdogStats: require('./getWatchdogStats'),

getEndedSkyblockAuctions: require('./skyblock/getEndedSkyblockAuctions'),
getSkyblockAuctions: require('./skyblock/getSkyblockAuctions'),
getSkyblockAuctionsByPlayer: require('./skyblock/getSkyblockAuctionsByPlayer'),
getSkyblockBazaar: require('./skyblock/getSkyblockBazaar'),
getSkyblockMember: require('./skyblock/getSkyblockMember'),
getSkyblockNews: require('./skyblock/getSkyblockNews'),
getSkyblockProfiles: require('./skyblock/getSkyblockProfiles')
};
22 changes: 13 additions & 9 deletions src/utils/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
/* eslint-disable no-extend-native */
const fs = require('fs');
// eslint-disable-next-line no-path-concat
const curDir = __dirname + '/';
module.exports = Array.from(fs.readdirSync(curDir, { withFileTypes: true }))
.filter((x) => x.name !== 'index.js')
.map((x) => x.isDirectory() ? Array.from(fs.readdirSync(curDir + x.name)).map((y) => ([y.split('.')[0], x.name + '/' + y])) : [[x.name.split('.')[0], x.name]])
.flat(1)
.reduce((pV, cV) => Object.assign(pV, { [cV[0]]: require(curDir + cV[1]) }), {});
module.exports = {
arrayTool: require('./arrayTools'),
Constants: require('./Constants'),
divide: require('./divide'),
isGuildID: require('./isGuildID'),
isUUID: require('./isUUID'),
oscillation: require('./oscillation'),
removeSnakeCase: require('./removeSnakeCase'),
SkyblockUtils: require('./SkyblockUtils'),
toIGN: require('./toIGN'),
toUuid: require('./toUuid'),
varInt: require('./varInt')
};

0 comments on commit aa8a835

Please # to comment.