warframe-worldstate-parser 2.25.4 → 2.25.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -10,6 +10,14 @@ Parse the Warframe worldstate into useable javascript objects.
10
10
  ## Documentation
11
11
  You can find the documentation [here](https://wfcd.github.io/warframe-worldstate-parser/)
12
12
 
13
+ ## Installation
14
+
15
+ ```shell
16
+ $ npm i -S warframe-worldstate-parser
17
+ ```
18
+
19
+ For the most part, you'll have a better experience consuming the product of this from the information in [Live version](#live-version)
20
+
13
21
  ## Example usage
14
22
 
15
23
  ```javascript
package/lib/News.js CHANGED
@@ -120,11 +120,11 @@ class News extends WorldstateObject {
120
120
  */
121
121
  this.translations = {};
122
122
  data.Messages.forEach((message) => {
123
+ this.translations[message.LanguageCode] = message.Message;
124
+
123
125
  if (langString.test(message.Message)) {
124
126
  this.translations[message.LanguageCode] = translator.languageString(message.Message, message.LanguageCode);
125
127
  }
126
-
127
- this.translations[message.LanguageCode] = message.Message;
128
128
  });
129
129
 
130
130
  /**
package/lib/WorldState.js CHANGED
@@ -91,9 +91,7 @@ function parseArray(ParserClass, dataArray, deps, uniqueField) {
91
91
  utemp[obj[uniqueField]] = obj;
92
92
  });
93
93
  return Array.from(arr).filter((obj) => {
94
- if (Object.prototype.hasOwnProperty.call(obj, 'active')) {
95
- return obj.active;
96
- }
94
+ if (obj && obj.active && typeof obj.active !== 'undefined') return obj.active;
97
95
  /* istanbul ignore next */
98
96
  return true;
99
97
  });
@@ -306,6 +304,10 @@ module.exports = class WorldState {
306
304
  arbitration: this.arbitration,
307
305
  } = externalMissions);
308
306
 
307
+ if (!this.arbitration || !Object.keys(this.arbitration).length) {
308
+ this.arbitration = undefined;
309
+ }
310
+
309
311
  /**
310
312
  * Current syndicate outposts
311
313
  * @type {SentientOutpost}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "warframe-worldstate-parser",
3
- "version": "2.25.4",
3
+ "version": "2.25.6",
4
4
  "description": "An Open parser for Warframe's Worldstate in Javascript",
5
5
  "types": "./types/main.d.ts",
6
6
  "main": "main.js",
@@ -116,6 +116,7 @@ declare class WorldState {
116
116
  * @type {Nightwave}
117
117
  */
118
118
  nightwave: Nightwave;
119
+ arbitration: any;
119
120
  /**
120
121
  * Current syndicate outposts
121
122
  * @type {SentientOutpost}