ogamejs 2.1.2 → 2.1.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/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [2.1.3](https://github.com/rolljee/ogamejs/compare/v2.1.2...v2.1.3) (2020-04-16)
6
+
5
7
  ### [2.1.2](https://github.com/rolljee/ogamejs/compare/v2.1.1...v2.1.2) (2020-04-12)
6
8
 
7
9
  ### [2.1.1](https://github.com/rolljee/ogamejs/compare/v2.1.0...v2.1.1) (2020-04-12)
package/README.md CHANGED
@@ -136,11 +136,11 @@ function getFusionReactor(reactor, targetLevel, energyTech, universeSpeed = 1) {
136
136
  */
137
137
  function parseInfoCompteData(data) {
138
138
  @return {
139
- planet: thePlanet.trim(),
140
- metal: metal.trim().split(' ')[1],
141
- crystal: crystal.trim().split(' ')[1],
142
- deut: deut.trim().split(' ')[1],
143
- temperature: Number.parseInt(temperature.trim(), 10),
139
+ planet: String,
140
+ metal: String,
141
+ crystal: String,
142
+ deut: String,
143
+ temperature: Number,
144
144
  }
145
145
  }
146
146
  ```
@@ -32,7 +32,14 @@ function toNumber() {
32
32
 
33
33
 
34
34
  function parseInfoCompteData(data) {
35
- // eslint-disable-next-line security/detect-unsafe-regex
35
+ var universeDataRe = new RegExp('([0-9]{3}-[a-z]{2})');
36
+
37
+ var _data$match$1$split = data.match(universeDataRe)[1].split('-'),
38
+ _data$match$1$split2 = _slicedToArray(_data$match$1$split, 2),
39
+ universe = _data$match$1$split2[0],
40
+ lang = _data$match$1$split2[1]; // eslint-disable-next-line security/detect-unsafe-regex
41
+
42
+
36
43
  var planetsRe = new RegExp('(?:Planète [0-9]+(.+))(?:s+(?:Planète [0-9]+))*', 'g');
37
44
  var planets = data.matchAll(planetsRe);
38
45
  var metalPointRe = new RegExp('Points dans les mines de métal : (.+)');
@@ -94,7 +101,9 @@ function parseInfoCompteData(data) {
94
101
  deut: deutPoint,
95
102
  total: metalPoint + crystalPoint + deutPoint
96
103
  },
97
- plasma: plasmaTechLevel
104
+ plasma: plasmaTechLevel,
105
+ universe: Number(universe),
106
+ lang: lang
98
107
  }; // eslint-disable-next-line no-restricted-syntax
99
108
 
100
109
  var _iterator = _createForOfIteratorHelper(planets),
@@ -99,7 +99,9 @@ describe('Infocompte informations should be correctly return when', function ()
99
99
  deut: 3343660,
100
100
  total: 10983438
101
101
  },
102
- plasma: 15
102
+ plasma: 15,
103
+ universe: 165,
104
+ lang: 'fr'
103
105
  });
104
106
  });
105
107
  });
package/package.json CHANGED
@@ -1,14 +1,12 @@
1
1
  {
2
2
  "name": "ogamejs",
3
- "version": "2.1.2",
3
+ "version": "2.1.6",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "scripts": {
7
7
  "start": "babel-node index.js",
8
8
  "commit": "git-cz",
9
- "prerelease": "babel src -d build",
10
- "release": "standard-version",
11
- "release:beta": "standard-version -p beta",
9
+ "build": "babel src -d build",
12
10
  "lint": "eslint .",
13
11
  "test": "jest"
14
12
  },
@@ -49,7 +47,7 @@
49
47
  "git-cz": "^4.3.1",
50
48
  "jest": "^25.3.0",
51
49
  "regenerator-runtime": "^0.13.5",
52
- "standard-version": "^7.1.0"
50
+ "standard-version": "^8.0.1"
53
51
  },
54
52
  "dependencies": {
55
53
  "lodash": "^4.17.15"