How to use the surya.dependencies function in surya

To help you get started, we’ve selected a few surya examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ConsenSys / vscode-solidity-auditor / src / features / commands.js View on Github external
}
                        
                    });
                    /*
                let draggable = surya.inheritance(files,{draggable:true})
                console.error(draggable)
                createWebViewBesides('imgPreview','imgPreview',draggable)
                */
                break;
            case "parse":
                ret = surya.parse(document.uri.fsPath);
                vscode.workspace.openTextDocument({content: ret, language: "markdown"})
                    .then(doc => vscode.window.showTextDocument(doc, vscode.ViewColumn.Beside));
                break;
            case "dependencies":
                ret = surya.dependencies(files, args[0]);

                let outTxt = [];

                if(ret){
                    outTxt.push(ret[0]);
                
                    if (ret.length < 2) {
                        outTxt = ['No Dependencies Found'];
                    }
                    else {
                        ret.shift();
                        const reducer = (accumulator, currentValue) => `${accumulator}\n  ↖ ${currentValue}`;
                        outTxt.push(`  ↖ ${ret.reduce(reducer)}`);
                    }

surya

Sūrya, The Sun God: A set of utilities for inspecting the structure of Solidity contracts.

Apache-2.0
Latest version published 24 days ago

Package Health Score

76 / 100
Full package analysis