Comparing version 1.1.24 to 1.1.25
@@ -127,3 +127,4 @@ "use strict"; | ||
if ((classOptions.hideLibraries && | ||
targetUmlClass.stereotype === umlClass_1.ClassStereotype.Library) || | ||
(sourceUmlClass.stereotype === umlClass_1.ClassStereotype.Library || | ||
targetUmlClass.stereotype === umlClass_1.ClassStereotype.Library)) || | ||
(classOptions.hideInterfaces && | ||
@@ -130,0 +131,0 @@ targetUmlClass.stereotype === umlClass_1.ClassStereotype.Interface)) { |
@@ -80,9 +80,15 @@ "use strict"; | ||
// if multiple Solidity source files | ||
// I think this is an Etherscan bug where the SourceCode field is encodes in two curly brackets. eg {{}} | ||
if (result.SourceCode[0] === '{') { | ||
// remove first { and last } from the SourceCode string so it can be JSON parsed | ||
const parableResultString = result.SourceCode.slice(1, -1); | ||
try { | ||
let parableResultString = result.SourceCode; | ||
// This looks like an Etherscan bug but we'll handle it here | ||
if (result.SourceCode[1] === '{') { | ||
// remove first { and last } from the SourceCode string so it can be JSON parsed | ||
parableResultString = result.SourceCode.slice(1, -1); | ||
} | ||
const sourceCodeObject = JSON.parse(parableResultString); | ||
const sourceFiles = Object.entries(sourceCodeObject.sources); | ||
// The getsource response from Etherscan is inconsistent so we need to handle both shapes | ||
const sourceFiles = sourceCodeObject.sources | ||
? Object.entries(sourceCodeObject.sources) | ||
: Object.entries(sourceCodeObject); | ||
return sourceFiles.map(([filename, code]) => ({ | ||
@@ -114,2 +120,5 @@ code: code.content, | ||
catch (err) { | ||
if (err.message) { | ||
throw err; | ||
} | ||
if (!err.response) { | ||
@@ -116,0 +125,0 @@ throw new Error(`Failed to ${description}. No HTTP response.`); |
{ | ||
"name": "sol2uml", | ||
"version": "1.1.24", | ||
"version": "1.1.25", | ||
"description": "Unified Modeling Language (UML) class diagram generator for Solidity contracts", | ||
@@ -22,3 +22,4 @@ "main": "./lib/index.js", | ||
"dependencies": { | ||
"axios": "^0.21.0", | ||
"@solidity-parser/parser": "^0.10.2", | ||
"axios": "^0.21.1", | ||
"commander": "^3.0.2", | ||
@@ -28,3 +29,2 @@ "debug": "^4.3.1", | ||
"klaw": "^3.0.0", | ||
"@solidity-parser/parser": "^0.10.1", | ||
"svg-to-png": "^4.0.0", | ||
@@ -31,0 +31,0 @@ "verror": "^1.10.0", |
@@ -15,2 +15,3 @@ # Solidity 2 UML | ||
The following installation assumes [Node.js](https://nodejs.org/en/download/) has already been installed which comes with [Node Package Manager (NPM)](https://www.npmjs.com/). | ||
`sol2uml` works with node 12 or above. [Node 10 is end-of-life 2021-04-30](https://nodejs.org/en/about/releases/) so time to upgrade if you are still running node 10. | ||
@@ -17,0 +18,0 @@ To install globally so you can run `sol2uml` from anywhere |
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
74279
1470
195
Updatedaxios@^0.21.1