@salesforcedevs/docs-components 1.3.304-amf-fix-alpha1 → 1.3.304-async-fix-alpha1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/docs-components",
3
- "version": "1.3.304-amf-fix-alpha1",
3
+ "version": "1.3.304-async-fix-alpha1",
4
4
  "description": "Docs Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -17,7 +17,8 @@
17
17
  "lodash.orderby": "^4.6.0",
18
18
  "lodash.uniqby": "^4.7.0",
19
19
  "query-string": "^7.1.3",
20
- "sentence-case": "^3.0.4"
20
+ "sentence-case": "^3.0.4",
21
+ "yieldable-json": "^2.0.1"
21
22
  },
22
23
  "devDependencies": {
23
24
  "@types/classnames": "^2.2.10",
@@ -9,7 +9,7 @@ import {
9
9
  } from "./utils";
10
10
  import type { TopicModel } from "./types";
11
11
  import { Json } from "typings/custom";
12
-
12
+ import { parse, stringify } from "yieldable-json";
13
13
 
14
14
  const TABLE_SIZE_MATCH = "769px";
15
15
 
@@ -24,24 +24,17 @@ export default class AmfTopic extends LightningElement {
24
24
  }
25
25
 
26
26
  set model(value: TopicModel) {
27
- const amfJsonObj = clone(value);
28
27
  if (
29
28
  !this.amf ||
30
- (value &&
31
- this._model &&
32
- value.amf !== this._model?.amf &&
33
- amfJsonObj?.amf)
29
+ (value && this._model && value.amf !== this._model?.amf)
34
30
  ) {
35
- this.amf = value && amfJsonObj.amf;
31
+ this.amf = value && clone(value.amf);
36
32
  }
37
33
  if (
38
34
  !this.type ||
39
- (value &&
40
- this._model &&
41
- value.type !== this._model?.type &&
42
- amfJsonObj?.type)
35
+ (value && this._model && value.type !== this._model?.type)
43
36
  ) {
44
- this.type = value && amfJsonObj.type;
37
+ this.type = value && clone(value.type);
45
38
  }
46
39
 
47
40
  this._model = value;
@@ -120,6 +113,7 @@ export default class AmfTopic extends LightningElement {
120
113
  * @param value JSON Serializable object to clone.
121
114
  * @returns A copy of Value. One that has been serialized and parsed via JSON. (Functions, Regex, etc are not preserved.)
122
115
  */
123
- function clone(value: any): any {
124
- return JSON.parse(JSON.stringify(value));
116
+ async function clone(value: any): any {
117
+ const parsedValue = await parse(stringify(value));
118
+ return parsedValue;
125
119
  }
@@ -0,0 +1,3 @@
1
+ onmessage = function (event) {
2
+ postMessage(JSON.parse(JSON.stringify(event.data)));
3
+ };