Skip to content

Commit ad6cf3b

Browse files
committed
removed jsdoc that docgen cannot recognize
1 parent 72b8dae commit ad6cf3b

24 files changed

+91
-301
lines changed

src/API/getServerInfo.js

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,7 @@ module.exports = async function (repeats) {
3535
});
3636
});
3737
};
38-
/**
39-
* Gets hypixel's ping
40-
* @param {number} amount Amount of times to ping
41-
* @param {net.Socket} cli Socket connected to hypixel
42-
* @returns {number}
43-
*/
38+
// eslint-disable-next-line require-jsdoc
4439
async function getPing(amount, cli) {
4540
let pingSum = 0;
4641
for (let i = 0; i < amount; i++) {
@@ -49,11 +44,8 @@ async function getPing(amount, cli) {
4944
cli.destroy();
5045
return Math.round(pingSum / amount);
5146
}
52-
/**
53-
* Pings hypixel
54-
* @param {net.Socket} cli Client socket, connected to hypixel.
55-
* @returns {number} Ping
56-
*/
47+
48+
// eslint-disable-next-line require-jsdoc
5749
async function ping(cli) {
5850
await cli.write(packetsToSend[2]);
5951
const time = Date.now();
@@ -63,12 +55,8 @@ async function ping(cli) {
6355
});
6456
});
6557
}
66-
/**
67-
* Parses the MOTD & Server status
68-
* @param {string} stringJson Parseable JSON string
69-
* @param {number} ping Ping of the server
70-
* @returns {Object} Object
71-
*/
58+
59+
// eslint-disable-next-line require-jsdoc
7260
function parseData(stringJson, ping) {
7361
try {
7462
return new ServerInfo(JSON.parse(stringJson), ping);

src/Private/rateLimit.js

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
const Errors = require('../Errors');
44

55
/* eslint-disable require-jsdoc */
6-
module.exports = class RateLimit {
6+
class RateLimit {
77
constructor() {
88
this.initialized = 0;
99
}
@@ -48,30 +48,10 @@ module.exports = class RateLimit {
4848
}
4949

5050
init(keyInfo, options, client) {
51-
/**
52-
* Rate limit Options
53-
* @type {RLOptions}
54-
*/
5551
this.options = options;
56-
/**
57-
* Requests in past min
58-
* @type {number}
59-
*/
6052
this.requests = 0;
61-
/**
62-
* Cooldown
63-
* @type {number}
64-
*/
6553
this.cooldownTime = 300000 / this.options.keyLimit; // Initial value
66-
/**
67-
* Request Queue ( Array of timestamps )
68-
* @type {number[]}
69-
*/
7054
this.requestQueue = [];
71-
/**
72-
* Client
73-
* @type {Client}
74-
*/
7555
this.client = client;
7656
return keyInfo
7757
.then((info) => {
@@ -89,7 +69,8 @@ module.exports = class RateLimit {
8969
});
9070
// Still make the requests per min possible
9171
}
92-
};
72+
}
73+
module.exports = RateLimit;
9374
/**
9475
* @typedef {Object} RLOptions
9576
* @property {number} keyLimit Max request of key per min

src/Private/requests.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@ const externalFetch = require('node-fetch');
44
const BASE_URL = 'https://api.hypixel.net';
55
const Errors = require('../Errors');
66
const Cache = require('./defaultCache');
7+
const Client = require('../Client.js');
78

8-
module.exports = class Requests {
9+
class Requests {
910
constructor(client, cache) {
1011
if (cache && !this.validateCustomCache()) throw new Error(Errors.INVALID_CACHE_HANDLER);
11-
/**
12-
* @type {Cache}
13-
*/
1412
this.cached = cache || new Cache();
1513
this.client = client;
1614
}
@@ -62,4 +60,6 @@ module.exports = class Requests {
6260
validateCustomCache(cache) {
6361
return !!(cache.set && cache.get && cache.delete && cache.keys);
6462
}
65-
};
63+
}
64+
65+
module.exports = Requests;

src/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ module.exports = {
3939
Product: require('./structures/SkyBlock/Bazzar/Product.js'),
4040
Order: require('./structures/SkyBlock/Bazzar/Order.js'),
4141

42-
/** Skyblock News */
42+
/* Skyblock News */
4343
SkyblockNews: require('./structures/SkyBlock/News/SkyblockNews'),
4444

4545
/* Booster */
@@ -71,8 +71,8 @@ module.exports = {
7171
/* Leaderboards */
7272
Leaderboard: require('./structures/Leaderboard.js'),
7373

74-
/** Server Info */
75-
ServerInfo: require('./structures/ServerInfo'),
74+
/* Server Info */
75+
ServerInfo: require('./structures/ServerInfo.js'),
7676

7777
/* Errors */
7878
Errors: require('./Errors.js'),

src/structures/Boosters/Booster.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,7 @@ class Booster {
7474
}
7575
}
7676

77-
/**
78-
* Parses the type of the booster
79-
* @param {Object} data Data
80-
* @returns {string} Type of booster
81-
*/
77+
// eslint-disable-next-line require-jsdoc
8278
function parseType(data) {
8379
if (data.stacked === true) return 'STACKED';
8480
if (!data.stacked) return 'QUEUED';

src/structures/Guild/Guild.js

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -170,33 +170,21 @@ class Guild {
170170
return this.members.find((member) => member.rank === 'Guild Master' || member.rank === 'GUILDMASTER');
171171
}
172172
}
173-
/**
174-
* @param {object} data
175-
* @return {GuildMember[]}
176-
*/
173+
// eslint-disable-next-line require-jsdoc
177174
function members(data) {
178175
return data.members.length ? data.members.map((m) => new GuildMember(m)) : [];
179176
}
180-
/**
181-
* @param {object} data
182-
* @return {GuildRank[]}
183-
*/
177+
// eslint-disable-next-line require-jsdoc
184178
function ranks(data) {
185179
return data.ranks && data.ranks.length ? data.ranks.map((r) => new GuildRank(r)).sort((a, b) => a.priority - b.priority) : [];
186180
}
187-
/**
188-
* @param {object} data
189-
* @return {number}
190-
*/
181+
// eslint-disable-next-line require-jsdoc
191182
function totalWeeklyGexp(data) {
192183
return members(data)
193184
.map((m) => m.weeklyExperience)
194185
.reduce((acc, cur) => acc + cur);
195186
}
196-
/**
197-
* @param {Object} data
198-
* @return {Array}
199-
*/
187+
// eslint-disable-next-line require-jsdoc
200188
function calculateExpHistory(data) {
201189
const finalObj = {};
202190
for (const day of Object.keys(data.members[0].expHistory)) {
@@ -208,11 +196,7 @@ function calculateExpHistory(data) {
208196
}
209197
return parseHistory(finalObj);
210198
}
211-
/**
212-
* Calculates and returns the exp after daily limit
213-
* @param {number} exp Experience
214-
* @return {number}
215-
*/
199+
// eslint-disable-next-line require-jsdoc
216200
function expLimit(exp) {
217201
return exp > 2e5 ? (exp > 7e5 ? 2.5e5 + Math.round(exp * 0.03) : 2e5 + Math.round((exp - 2e5) / 10)) : exp;
218202
}

src/structures/MiniGames/Arcade.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -526,11 +526,7 @@ class ZombiesStats {
526526
this.zombieKills = data[`zombie_kills_zombies${type}`] || 0;
527527
}
528528
}
529-
/**
530-
* Parses Kills in Zombie and return it as an object
531-
* @param {Object} data data from API
532-
* @returns {Object}
533-
*/
529+
// eslint-disable-next-line require-jsdoc
534530
function parseZombiesKills(data) {
535531
const matches = Array.from(Object.keys(data))
536532
.map((x) => x.match(/^([A-z]+)_zombie_kills_zombies$/))

src/structures/MiniGames/ArenaBrawl.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,7 @@ class ArenaBrawl {
2323
};
2424
}
2525
}
26-
/**
27-
* @param {object} data
28-
* @param {string} mode
29-
* @return {{kills:number,deaths:number,KDRatio:number,wins:number,losses:number,WLRatio:number}}
30-
*/
26+
// eslint-disable-next-line require-jsdoc
3127
function generateModeStats(data, mode) {
3228
return {
3329
kills: data[`kills_${mode}`] || 0,

src/structures/MiniGames/BedWars.js

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,7 @@ class BedWars {
202202
this.castle = generateStatsForMode(data, 'castle');
203203
}
204204
}
205-
/**
206-
* @param {number} level
207-
* @return {string}
208-
*/
205+
// eslint-disable-next-line require-jsdoc
209206
function getBedWarsPrestige(level) {
210207
// eslint-disable-next-line max-len
211208
if (level >= 5000) return 'Eternal';
@@ -271,10 +268,7 @@ const XP_PER_PRESTIGE = 96 * 5000 + EASY_LEVELS_XP;
271268
const LEVELS_PER_PRESTIGE = 100;
272269
const HIGHEST_PRESTIGE = 10;
273270

274-
/**
275-
* @param {number} level
276-
* @return {number}
277-
*/
271+
// eslint-disable-next-line require-jsdoc
278272
function getExpForLevel(level) {
279273
if (level === 0) return 0;
280274
const respectedLevel = getLevelRespectingPrestige(level);
@@ -291,21 +285,15 @@ function getExpForLevel(level) {
291285
}
292286
return 5000;
293287
}
294-
/**
295-
* @param {number} level
296-
* @return {number}
297-
*/
288+
// eslint-disable-next-line require-jsdoc
298289
function getLevelRespectingPrestige(level) {
299290
if (level > HIGHEST_PRESTIGE * LEVELS_PER_PRESTIGE) {
300291
return level - HIGHEST_PRESTIGE * LEVELS_PER_PRESTIGE;
301292
} else {
302293
return level % LEVELS_PER_PRESTIGE;
303294
}
304295
}
305-
/**
306-
* @param {number} exp
307-
* @return {number}
308-
*/
296+
// eslint-disable-next-line require-jsdoc
309297
function getLevelForExp(exp) {
310298
const prestiges = Math.floor(exp / XP_PER_PRESTIGE);
311299
let level = prestiges * LEVELS_PER_PRESTIGE;

src/structures/MiniGames/BlitzSurvivalGames.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,7 @@ class BlitzSurvivalGames {
8787
this.kitStats = generateKitStats(data);
8888
}
8989
}
90-
/**
91-
* @param {object} data
92-
* @return {object}
93-
*/
90+
// eslint-disable-next-line require-jsdoc
9491
function generateKitStats(data) {
9592
const stats = [];
9693
for (let i = 0; i < kits.length; i++) {

0 commit comments

Comments
 (0)