openchs-models 1.30.62 → 1.30.64

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.
@@ -7,7 +7,7 @@ exports.default = void 0;
7
7
 
8
8
  var _BaseEntity = _interopRequireDefault(require("./BaseEntity"));
9
9
 
10
- var _ParseUtil = _interopRequireDefault(require("./utility/ParseUtil"));
10
+ var _structuredClone = require("@ungap/structured-clone");
11
11
 
12
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
13
 
@@ -107,21 +107,21 @@ class CustomDashboardCache extends _BaseEntity.default {
107
107
  }
108
108
 
109
109
  getSelectedValues() {
110
- return this.selectedValuesJSON && _ParseUtil.default.parse(this.selectedValuesJSON) || {};
110
+ return this.selectedValuesJSON && (0, _structuredClone.deserialize)(JSON.parse(this.selectedValuesJSON)) || {};
111
111
  }
112
112
 
113
113
  getFilterErrors() {
114
- return this.filterErrorsJSON && _ParseUtil.default.parse(this.filterErrorsJSON) || {};
114
+ return this.filterErrorsJSON && (0, _structuredClone.deserialize)(JSON.parse(this.filterErrorsJSON)) || {};
115
115
  }
116
116
 
117
117
  getRuleInput() {
118
- return this.ruleInputJSON && _ParseUtil.default.parse(this.ruleInputJSON) || {
118
+ return this.ruleInputJSON && (0, _structuredClone.deserialize)(JSON.parse(this.ruleInputJSON)) || {
119
119
  ruleInputArray: null
120
120
  };
121
121
  }
122
122
 
123
123
  getTransformedFilters() {
124
- return this.transformedFiltersJSON && _ParseUtil.default.parse(this.transformedFiltersJSON) || {
124
+ return this.transformedFiltersJSON && (0, _structuredClone.deserialize)(JSON.parse(this.transformedFiltersJSON)) || {
125
125
  date: new Date(),
126
126
  applied: false,
127
127
  selectedLocations: [],
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "openchs-models",
3
3
  "description": "OpenCHS data model to be used by front end clients",
4
- "version": "1.30.62",
4
+ "version": "1.30.64",
5
5
  "private": false,
6
6
  "repository": {
7
7
  "type": "git",
@@ -27,8 +27,8 @@
27
27
  ]
28
28
  },
29
29
  "license": "AGPL-3.0",
30
- "dependencies": {},
31
30
  "peerDependencies": {
31
+ "@ungap/structured-clone": "*",
32
32
  "lodash": "*",
33
33
  "moment": "*"
34
34
  },
@@ -39,6 +39,7 @@
39
39
  "@babel/plugin-proposal-object-rest-spread": "^7.4.4",
40
40
  "@babel/preset-env": "^7.4.5",
41
41
  "@babel/preset-typescript": "^7.7.7",
42
+ "@ungap/structured-clone": "1.2.0",
42
43
  "babel-jest": "^24.8.0",
43
44
  "babel-loader": "^8.0.0-beta.4",
44
45
  "babel-plugin-istanbul": "^5.1.0",
package/yarn.lock CHANGED
@@ -1029,6 +1029,11 @@
1029
1029
  dependencies:
1030
1030
  "@types/yargs-parser" "*"
1031
1031
 
1032
+ "@ungap/structured-clone@1.2.0":
1033
+ version "1.2.0"
1034
+ resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406"
1035
+ integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==
1036
+
1032
1037
  "@webassemblyjs/ast@1.9.0":
1033
1038
  version "1.9.0"
1034
1039
  resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.9.0.tgz#bd850604b4042459a5a41cd7d338cbed695ed964"
@@ -1,27 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- class ParseUtil {
9
- static parse(jsonValue) {
10
- const iso8061 = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/;
11
- return JSON.parse(jsonValue, function (key, value) {
12
- if (typeof value != 'string') {
13
- return value;
14
- }
15
-
16
- if (iso8061 && value.match(iso8061)) {
17
- return new Date(value);
18
- }
19
-
20
- return value;
21
- });
22
- }
23
-
24
- }
25
-
26
- var _default = ParseUtil;
27
- exports.default = _default;