@kmkf-fe-packages/kmkf-utils 0.5.2-alpha.1 → 0.5.2-alpha.2

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.
@@ -23,9 +23,18 @@ interface PlatInterface {
23
23
  export default class PlatData {
24
24
  private static instance;
25
25
  platTypeList: PlatInterface[];
26
+ platMap: {
27
+ [prop in string]: string;
28
+ };
26
29
  constructor();
27
30
  initData: () => void;
28
31
  getPlatData: () => PlatInterface[];
32
+ /**
33
+ * 获取平台类型和平台名称映射关系
34
+ */
35
+ getPlatMap: () => {
36
+ [x: string]: string;
37
+ };
29
38
  static getInstance(): PlatData;
30
39
  }
31
40
  export declare type PlatDataClass = PlatData;
@@ -17,6 +17,7 @@ var PlatData = /*#__PURE__*/function () {
17
17
  var _this = this;
18
18
  _classCallCheck(this, PlatData);
19
19
  _defineProperty(this, "platTypeList", void 0);
20
+ _defineProperty(this, "platMap", void 0);
20
21
  _defineProperty(this, "initData", function () {
21
22
  var _this$platTypeList;
22
23
  if (((_this$platTypeList = _this.platTypeList) === null || _this$platTypeList === void 0 ? void 0 : _this$platTypeList.length) > 0) return;
@@ -31,13 +32,22 @@ var PlatData = /*#__PURE__*/function () {
31
32
  platType.notJoinList = platType.notJoinList || [];
32
33
  var list = [].concat(_toConsumableArray(platType.alreadyJoinedList), _toConsumableArray(platType.notJoinList));
33
34
  _this.platTypeList = list;
35
+ var platMap = list === null || list === void 0 ? void 0 : list.reduce(function (cur, nxt) {
36
+ cur[nxt.platformType] = nxt.platformName;
37
+ return cur;
38
+ }, {});
39
+ _this.platMap = platMap;
34
40
  }
35
41
  });
36
42
  });
37
43
  _defineProperty(this, "getPlatData", function () {
38
44
  return _this.platTypeList;
39
45
  });
46
+ _defineProperty(this, "getPlatMap", function () {
47
+ return _this.platMap;
48
+ });
40
49
  this.platTypeList = [];
50
+ this.platMap = {};
41
51
  this.initData();
42
52
  }
43
53
  _createClass(PlatData, null, [{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/kmkf-utils",
3
- "version": "0.5.2-alpha.1",
3
+ "version": "0.5.2-alpha.2",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [
@@ -30,5 +30,5 @@
30
30
  "gitHooks": {
31
31
  "pre-commit": "lint-staged"
32
32
  },
33
- "gitHead": "a8f3f34d2f553a55c16f30dab39d3a74bf48f2d3"
33
+ "gitHead": "b27e9baf87f3bc49ebb799a1681bf85439940edb"
34
34
  }