Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private getDecodedNode = ( node: TreeNodeModel ): TreeNodeModel => {
let convertedNode = JSON.parse( JSON.stringify( node ) ) as TreeNodeModel
if ( convertedNode.data && convertedNode.data.propertiesMap && !$.isEmptyObject( convertedNode.data.propertiesMap ) ) {
let nodeKeyValues = JSON.parse( JSON.stringify( convertedNode.data.propertiesMap ) ) as KeyValDef
for ( const key in nodeKeyValues ) {
if ( nodeKeyValues[key].contentType === 'text/plain' ) {
nodeKeyValues[key].contentBytes = base64Decode( nodeKeyValues[key].contentBytes )
}
}
convertedNode.data.propertiesMap = nodeKeyValues
}
return convertedNode
}