@twreporter/core 1.8.2-rc.1 → 1.8.2-rc.3

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
@@ -3,6 +3,29 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.8.2-rc.3](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/core@1.8.2-rc.2...@twreporter/core@1.8.2-rc.3) (2023-02-18)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * rename object ([c13468f](https://github.com/twreporter/twreporter-npm-packages/commit/c13468fe9a0ddea0e699a0cabc4c39993c6d221e))
12
+ * replace Object.fromentries() to avoid version compatiblity issue ([7623323](https://github.com/twreporter/twreporter-npm-packages/commit/762332376e6c9a941f55ebf63ec8e6da586ab6ef))
13
+
14
+
15
+
16
+
17
+
18
+ ## [1.8.2-rc.2](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/core@1.8.2-rc.1...@twreporter/core@1.8.2-rc.2) (2023-02-16)
19
+
20
+
21
+ ### Bug Fixes
22
+
23
+ * fix category link issue & add error handling ([9bd5f76](https://github.com/twreporter/twreporter-npm-packages/commit/9bd5f76a8b37eff4c634c17dfde30cbe7ac6f1b9))
24
+
25
+
26
+
27
+
28
+
6
29
  ## [1.8.2-rc.1](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/core@1.8.2-rc.0...@twreporter/core@1.8.2-rc.1) (2023-02-13)
7
30
 
8
31
 
@@ -3,10 +3,22 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports["default"] = exports.CATEGORY_SET = exports.SUBCATEGORY_ID = exports.SUBCATEGORY_LABEL = exports.SUBCATEGORY_PATH = exports.CATEGORY_ID = exports.CATEGORY_LABEL = exports.CATEGORY_ORDER = exports.CATEGORY_PATH = void 0;
6
+ exports["default"] = exports.CATEGORY_SET = exports.SUBCATEGORY_ID = exports.SUBCATEGORY_LABEL = exports.SUBCATEGORY_PATH = exports.GET_CATEGORY_PATH_FROM_ID = exports.CATEGORY_ID = exports.CATEGORY_LABEL = exports.CATEGORY_ORDER = exports.CATEGORY_PATH = void 0;
7
7
 
8
8
  var _CATEGORY_LABEL, _CATEGORY_ID, _SUBCATEGORY_LABEL, _SUBCATEGORY_ID, _CATEGORY_SET;
9
9
 
10
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
11
+
12
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
13
+
14
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
15
+
16
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
17
+
18
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
19
+
20
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
21
+
10
22
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
11
23
 
12
24
  var categoryPath = {
@@ -29,8 +41,23 @@ var CATEGORY_ORDER = [categoryPath.world, categoryPath.humanrights, categoryPath
29
41
  exports.CATEGORY_ORDER = CATEGORY_ORDER;
30
42
  var CATEGORY_LABEL = (_CATEGORY_LABEL = {}, _defineProperty(_CATEGORY_LABEL, categoryPath.world, '國際兩岸'), _defineProperty(_CATEGORY_LABEL, categoryPath.humanrights, '人權司法'), _defineProperty(_CATEGORY_LABEL, categoryPath.politicsAndSociety, '政治社會'), _defineProperty(_CATEGORY_LABEL, categoryPath.health, '醫療健康'), _defineProperty(_CATEGORY_LABEL, categoryPath.environment, '環境永續'), _defineProperty(_CATEGORY_LABEL, categoryPath.econ, '經濟產業'), _defineProperty(_CATEGORY_LABEL, categoryPath.culture, '文化生活'), _defineProperty(_CATEGORY_LABEL, categoryPath.education, '教育校園'), _defineProperty(_CATEGORY_LABEL, categoryPath.podcast, 'Podcast'), _defineProperty(_CATEGORY_LABEL, categoryPath.opinion, '評論'), _defineProperty(_CATEGORY_LABEL, categoryPath.photography, '影像'), _CATEGORY_LABEL);
31
43
  exports.CATEGORY_LABEL = CATEGORY_LABEL;
32
- var CATEGORY_ID = (_CATEGORY_ID = {}, _defineProperty(_CATEGORY_ID, categoryPath.world, '63206383207bf7c5f871622c'), _defineProperty(_CATEGORY_ID, categoryPath.humanrights, '63206383207bf7c5f8716234'), _defineProperty(_CATEGORY_ID, categoryPath.politicsAndSociety, '63206383207bf7c5f871623d'), _defineProperty(_CATEGORY_ID, categoryPath.health, '63206383207bf7c5f8716245'), _defineProperty(_CATEGORY_ID, categoryPath.environment, '63206383207bf7c5f871624d'), _defineProperty(_CATEGORY_ID, categoryPath.econ, '63206383207bf7c5f8716254'), _defineProperty(_CATEGORY_ID, categoryPath.culture, '63206383207bf7c5f8716259'), _defineProperty(_CATEGORY_ID, categoryPath.education, '63206383207bf7c5f8716260'), _defineProperty(_CATEGORY_ID, categoryPath.podcast, '63206383207bf7c5f8716266'), _defineProperty(_CATEGORY_ID, categoryPath.opinion, '63206383207bf7c5f8716269'), _defineProperty(_CATEGORY_ID, categoryPath.photography, '574d028748fa171000c45d48'), _CATEGORY_ID);
44
+ var CATEGORY_ID = (_CATEGORY_ID = {}, _defineProperty(_CATEGORY_ID, categoryPath.world, '63206383207bf7c5f871622c'), _defineProperty(_CATEGORY_ID, categoryPath.humanrights, '63206383207bf7c5f8716234'), _defineProperty(_CATEGORY_ID, categoryPath.politicsAndSociety, '63206383207bf7c5f871623d'), _defineProperty(_CATEGORY_ID, categoryPath.health, '63206383207bf7c5f8716245'), _defineProperty(_CATEGORY_ID, categoryPath.environment, '63206383207bf7c5f871624d'), _defineProperty(_CATEGORY_ID, categoryPath.econ, '63206383207bf7c5f8716254'), _defineProperty(_CATEGORY_ID, categoryPath.culture, '63206383207bf7c5f8716259'), _defineProperty(_CATEGORY_ID, categoryPath.education, '63206383207bf7c5f8716260'), _defineProperty(_CATEGORY_ID, categoryPath.podcast, '63206383207bf7c5f8716266'), _defineProperty(_CATEGORY_ID, categoryPath.opinion, '63206383207bf7c5f8716269'), _defineProperty(_CATEGORY_ID, categoryPath.photography, '574d028748fa171000c45d48'), _CATEGORY_ID); // flip CATEGORY_ID to a {id: path} object
45
+
33
46
  exports.CATEGORY_ID = CATEGORY_ID;
47
+ var categoryIDToPath = {};
48
+ Object.entries(CATEGORY_ID).forEach(function (_ref) {
49
+ var _ref2 = _slicedToArray(_ref, 2),
50
+ key = _ref2[0],
51
+ value = _ref2[1];
52
+
53
+ categoryIDToPath[value] = key;
54
+ });
55
+
56
+ var GET_CATEGORY_PATH_FROM_ID = function GET_CATEGORY_PATH_FROM_ID(id) {
57
+ return categoryIDToPath[id];
58
+ };
59
+
60
+ exports.GET_CATEGORY_PATH_FROM_ID = GET_CATEGORY_PATH_FROM_ID;
34
61
  var subcategoryPath = {
35
62
  all: 'all',
36
63
  hk: 'hk',
@@ -102,6 +129,7 @@ var _default = {
102
129
  CATEGORY_ORDER: CATEGORY_ORDER,
103
130
  CATEGORY_LABEL: CATEGORY_LABEL,
104
131
  CATEGORY_ID: CATEGORY_ID,
132
+ GET_CATEGORY_PATH_FROM_ID: GET_CATEGORY_PATH_FROM_ID,
105
133
  SUBCATEGORY_LABEL: SUBCATEGORY_LABEL,
106
134
  SUBCATEGORY_ID: SUBCATEGORY_ID,
107
135
  CATEGORY_SET: CATEGORY_SET
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twreporter/core",
3
- "version": "1.8.2-rc.1",
3
+ "version": "1.8.2-rc.3",
4
4
  "main": "lib/index.js",
5
5
  "repository": "https://github.com/twreporter/twreporter-npm-packages.git",
6
6
  "author": "twreporter <developer@twreporter.org>",
@@ -19,5 +19,5 @@
19
19
  "files": [
20
20
  "lib"
21
21
  ],
22
- "gitHead": "1ebf9eeda3976aad554b576bf974c2718752ef4e"
22
+ "gitHead": "83330b20f186656318e07a6eef253b1e1a0e17b8"
23
23
  }