Skip to content

Commit

Permalink
Update ranks to include MAPPER rank
Browse files Browse the repository at this point in the history
  • Loading branch information
Spencer committed Jun 9, 2017
1 parent a11ee4f commit a9fe251
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions config/ranks.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module.exports = {
'TWITCH',
'YOUTUBE',
'BUILDER',
'MAPPER',
'MAPLEAD',
'MEDIA',
'TRAINEE',
Expand All @@ -27,6 +28,7 @@ module.exports = {
'NONE' : 'PLAYER',
'ALL' : 'PLAYER',

'MOOTUBE' : 'YT',
'YOUTUBESMALL' : 'YT',

'MAPDEV' : 'BUILDER',
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
require('./lib/Prototypes');
require('./lib/defs');

module.exports = require(`./lib/MineplexAPIWrapper`);
12 changes: 6 additions & 6 deletions lib/Prototypes.js → lib/defs.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,25 +50,25 @@ String.prototype.toChalkFormatting = function () {
};

Boolean.prototype.toOnlineString = function () {
return (this) ? 'online' : 'offline';
return (this === true) ? 'online' : 'offline';
};

Boolean.prototype.toActiveString = function () {
return (this) ? 'active' : 'inactive';
return (this === true) ? 'active' : 'inactive';
};

Number.prototype.toHumanReadable = function () {
Number.prototype.toHumanReadable = function (fix = 1) {
let days, hours, minutes, seconds = this;

if(seconds <= 60) return `${seconds} seconds`;

minutes = (seconds / 60).toFixed(1);
minutes = (seconds / 60).toFixed(fix);

if(minutes <= 60) return `${minutes} minutes`;

hours = (minutes / 60 ).toFixed(1);
hours = (minutes / 60 ).toFixed(fix);

if(hours <= 60) return `${hours} hours`;

return `${(hours/24).toFixed(1)} days`;
return `${(hours/24).toFixed(fix)} days`;
};

0 comments on commit a9fe251

Please sign in to comment.