Skip to content

Commit

Permalink
fix(types): fissure, zariman, cambion syntax (#441)
Browse files Browse the repository at this point in the history
closes #440 

Co-authored-by: Matej Voboril <[email protected]>
  • Loading branch information
FubyCoder and TobiTenno authored Apr 25, 2023
1 parent 1a060a2 commit 98ad93c
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 11 deletions.
8 changes: 5 additions & 3 deletions lib/CambionCycle.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const WorldstateObject = require('./WorldstateObject');
* @extends {WorldstateObject}
* @property {string} timeLeft time rendering of amount of time left
*/
module.exports = class CambionCycle extends WorldstateObject {
class CambionCycle extends WorldstateObject {
/**
* @param {CetusCycle} cetusCycle Match data from cetus cycle for data
* @param {Object} deps The dependencies object
Expand All @@ -25,10 +25,12 @@ module.exports = class CambionCycle extends WorldstateObject {
}

/**
* Get whether or not the event has expired
* Get whether the event has expired
* @returns {boolean}
*/
getExpired() {
return this.timeDate.fromNow(this.expiry) < 0;
}
};
}

module.exports = CambionCycle;
6 changes: 4 additions & 2 deletions lib/Fissure.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const WorldstateObject = require('./WorldstateObject');
* Represents a fissure mission
* @extends {WorldstateObject}
*/
module.exports = class Fissure extends WorldstateObject {
class Fissure extends WorldstateObject {
/**
* @param {Object} data The fissure data
* @param {Object} deps The dependencies object
Expand Down Expand Up @@ -137,4 +137,6 @@ module.exports = class Fissure extends WorldstateObject {
toString() {
return `[${this.getETAString()}] ${this.tier} fissure at ${this.node} - ${this.enemy} ${this.missionType}`;
}
};
}

module.exports = Fissure;
7 changes: 4 additions & 3 deletions lib/WorldState.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const Kuva = require('./Kuva');
const SentientOutpost = require('./SentientOutpost');
const CambionCycle = require('./CambionCycle');
const SteelPathOffering = require('./SteelPathOffering');
const Dependency = require('./supporting/Dependency'); // eslint-disable-line no-unused-vars

// needed for type declarations
const MarkdownSettings = require('./supporting/MarkdownSettings');
Expand Down Expand Up @@ -79,8 +80,8 @@ const defaultDeps = {
* @param {Object} ParserClass class for parsing data
* @param {Array<BaseContentObject>} dataArray array of raw data
* @param {Dependency} deps shared dependency object
* @param {*} uniqueField field to treat as unique
* @returns {WorldstateObject}
* @param {*} [uniqueField] field to treat as unique
* @returns {WorldstateObject[]}
*/
function parseArray(ParserClass, dataArray, deps, uniqueField) {
const arr = (dataArray || []).map((d) => new ParserClass(d, deps));
Expand Down Expand Up @@ -164,7 +165,7 @@ module.exports = class WorldState {

/**
* The current fissures: 'ActiveMissions' & 'VoidStorms'
* @type {Array.<News>}
* @type {Array.<Fissure>}
*/
this.fissures = parseArray(deps.Fissure, data.ActiveMissions, deps).concat(
parseArray(deps.Fissure, data.VoidStorms, deps)
Expand Down
6 changes: 4 additions & 2 deletions lib/ZarimanCycle.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const stateMaximum = 9000000;
* Represents the current Zariman Corpus/Grineer Cycle
* @extends {WorldstateObject}
*/
module.exports = class ZarimanCycle extends WorldstateObject {
class ZarimanCycle extends WorldstateObject {
/**
* @param {Date} bountiesEndDate The current zariman cycle expiry
* @param {Object} deps The dependencies object
Expand Down Expand Up @@ -138,4 +138,6 @@ module.exports = class ZarimanCycle extends WorldstateObject {

return lines.join(this.mdConfig.lineEnd);
}
};
}

module.exports = ZarimanCycle;
2 changes: 1 addition & 1 deletion test/integration/integration.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe('WorldState (integration)', () => {
wsl = new WorldState(ws, { logger, locale: 'en' });
wsl = new WorldState(ws, { logger, locale: 'en', kuvaData });
} catch (e) {
console.error(e);
console.error(e); // eslint-disable-line no-console
throw e;
}
}).should.not.throw();
Expand Down

0 comments on commit 98ad93c

Please sign in to comment.