wiki-entity 0.5.11 → 0.5.12

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.
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getEntityCountryCode = void 0;
4
- const countries = require('../../data/countries.json');
4
+ const countries = require("../../data/countries.json");
5
5
  function getEntityCountryCode(wikiEntity) {
6
- if (!wikiEntity) {
6
+ if (!(wikiEntity === null || wikiEntity === void 0 ? void 0 : wikiEntity.claims)) {
7
7
  return null;
8
8
  }
9
9
  const countryIds = getEntityCountryIds(wikiEntity);
@@ -17,6 +17,9 @@ function getEntityCountryCode(wikiEntity) {
17
17
  }
18
18
  exports.getEntityCountryCode = getEntityCountryCode;
19
19
  function getEntityCountryIds(wikiEntity) {
20
- let prop = wikiEntity.claims.P17 || wikiEntity.claims.P27 || wikiEntity.claims.P495 || wikiEntity.claims.P1532;
21
- return prop && prop.values.map(item => item.value) || [];
20
+ let prop = wikiEntity.claims.P17 ||
21
+ wikiEntity.claims.P27 ||
22
+ wikiEntity.claims.P495 ||
23
+ wikiEntity.claims.P1532;
24
+ return (prop && prop.values.map((item) => item.value)) || [];
22
25
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wiki-entity",
3
- "version": "0.5.11",
3
+ "version": "0.5.12",
4
4
  "description": "Wiki entity fetcher",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./types/index.d.ts",
@@ -41,6 +41,6 @@
41
41
  "typescript": "latest"
42
42
  },
43
43
  "dependencies": {
44
- "axios": "^0.21.1"
44
+ "axios": "^1.6.0"
45
45
  }
46
46
  }