@salesforcedevs/docs-components
Advanced tools
Comparing version 1.3.300-fix-alpha1 to 1.3.300-fix-alpha2
{ | ||
"name": "@salesforcedevs/docs-components", | ||
"version": "1.3.300-fix-alpha1", | ||
"version": "1.3.300-fix-alpha2", | ||
"description": "Docs Lightning web components for DSC", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -1478,6 +1478,14 @@ import { LightningElement, api, track } from "lwc"; | ||
// Adding stringify inside try/catch | ||
let amfString = ""; | ||
try { | ||
amfString = JSON.stringify(this.amfMap[referenceId].model); | ||
} catch (error) { | ||
console.error(`Error stringifying amf model: ${error}`); | ||
} | ||
// This updates the component in the content section. | ||
this.topicModel = { | ||
type, | ||
amf: JSON.stringify(this.amfMap[referenceId].model), | ||
amf: amfString, | ||
parser: this.amfMap[referenceId].parser, | ||
@@ -1484,0 +1492,0 @@ id: amfId |
@@ -17,3 +17,3 @@ import { LightningElement, api } from "lwc"; | ||
private _model: TopicModel | undefined; | ||
private amf: Json | undefined; | ||
private amf: Json; | ||
private type: string | undefined; | ||
@@ -31,3 +31,7 @@ | ||
) { | ||
this.amf = value && JSON.parse(value.amf); | ||
try { | ||
this.amf = value && JSON.parse(value.amf); | ||
} catch (error) { | ||
console.error(`Error parsing amf model:: ${error}`); | ||
} | ||
} | ||
@@ -38,3 +42,3 @@ if ( | ||
) { | ||
this.type = value && value.type; | ||
this.type = value && clone(value.type); | ||
} | ||
@@ -118,4 +122,4 @@ | ||
*/ | ||
// function clone(value: any): any { | ||
// return JSON.parse(JSON.stringify(value)); | ||
// } | ||
function clone(value: any): any { | ||
return JSON.parse(JSON.stringify(value)); | ||
} |
@@ -54,4 +54,4 @@ import { Json } from "typings/custom"; | ||
type: string; | ||
amf: AmfModel; | ||
amf: string; | ||
parser: AmfModelParser; | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
254795
6537