@salesforcedevs/docs-components 1.3.300-fix-alpha2 → 1.3.300-fix-alpha3

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.300-fix-alpha2",
3
+ "version": "1.3.300-fix-alpha3",
4
4
  "description": "Docs Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -1476,9 +1476,9 @@ export default class AmfReference extends LightningElement {
1476
1476
  const { referenceId, amfId, type } = this.selectedTopic!;
1477
1477
 
1478
1478
  // Adding stringify inside try/catch
1479
- let amfString = "";
1479
+ let amfModelString = "";
1480
1480
  try {
1481
- amfString = JSON.stringify(this.amfMap[referenceId].model);
1481
+ amfModelString = JSON.stringify(this.amfMap[referenceId].model);
1482
1482
  } catch (error) {
1483
1483
  console.error(`Error stringifying amf model: ${error}`);
1484
1484
  }
@@ -1486,7 +1486,7 @@ export default class AmfReference extends LightningElement {
1486
1486
  // This updates the component in the content section.
1487
1487
  this.topicModel = {
1488
1488
  type,
1489
- amf: amfString,
1489
+ amf: amfModelString,
1490
1490
  parser: this.amfMap[referenceId].parser,
1491
1491
  id: amfId
1492
1492
  };
@@ -30,14 +30,14 @@ export default class AmfTopic extends LightningElement {
30
30
  try {
31
31
  this.amf = value && JSON.parse(value.amf);
32
32
  } catch (error) {
33
- console.error(`Error parsing amf model:: ${error}`);
33
+ console.error(`Error parsing amf model: ${error}`);
34
34
  }
35
35
  }
36
36
  if (
37
37
  !this.type ||
38
38
  (value && this._model && value.type !== this._model?.type)
39
39
  ) {
40
- this.type = value && clone(value.type);
40
+ this.type = value && value.type;
41
41
  }
42
42
 
43
43
  this._model = value;
@@ -109,13 +109,3 @@ export default class AmfTopic extends LightningElement {
109
109
  }
110
110
  }
111
111
  }
112
-
113
- /**
114
- * The underlying web components we use from api-console mutate their models we pass in.
115
- * Since LWC makes them Read Only, we need to copy them before passing to the Web Component.
116
- * @param value JSON Serializable object to clone.
117
- * @returns A copy of Value. One that has been serialized and parsed via JSON. (Functions, Regex, etc are not preserved.)
118
- */
119
- function clone(value: any): any {
120
- return JSON.parse(JSON.stringify(value));
121
- }