New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

solidity-docgen

Package Overview
Dependencies
Maintainers
1
Versions
90
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

solidity-docgen - npm Package Compare versions

Comparing version 0.3.4 to 0.3.5

dist/memoize.js

39

dist/solidity.js
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -9,2 +15,3 @@ return (mod && mod.__esModule) ? mod : { "default": mod };

const execall_1 = __importDefault(require("execall"));
const memoize_1 = require("./memoize");
const handlebars_1 = require("./handlebars");

@@ -35,2 +42,5 @@ class SoliditySource {

}
__decorate([
memoize_1.memoize
], SoliditySource.prototype, "file", null);
exports.SoliditySource = SoliditySource;

@@ -48,2 +58,5 @@ class SolidityFile {

}
__decorate([
memoize_1.memoize
], SolidityFile.prototype, "contracts", null);
class SolidityContract {

@@ -82,2 +95,13 @@ constructor(source, file, astNode) {

}
get inheritedItems() {
const functions = lodash_1.groupBy(this.functions, f => f.contract.astId);
const events = lodash_1.groupBy(this.events, f => f.contract.astId);
const modifiers = lodash_1.groupBy(this.modifiers, f => f.contract.astId);
return this.inheritance.map(contract => ({
contract,
functions: functions[contract.astId],
events: events[contract.astId],
modifiers: modifiers[contract.astId],
}));
}
get events() {

@@ -109,2 +133,11 @@ return lodash_1.uniqBy(lodash_1.flatten(this.inheritance.map(c => c.ownEvents)), f => f.signature);

}
__decorate([
memoize_1.memoize
], SolidityContract.prototype, "ownFunctions", null);
__decorate([
memoize_1.memoize
], SolidityContract.prototype, "ownEvents", null);
__decorate([
memoize_1.memoize
], SolidityContract.prototype, "ownModifiers", null);
exports.SolidityContract = SolidityContract;

@@ -137,2 +170,5 @@ class SolidityContractItem {

}
__decorate([
memoize_1.memoize
], SolidityContractItem.prototype, "args", null);
class SolidityFunction extends SolidityContractItem {

@@ -155,2 +191,5 @@ constructor(contract, astNode) {

}
__decorate([
memoize_1.memoize
], SolidityFunction.prototype, "outputs", null);
class SolidityEvent extends SolidityContractItem {

@@ -157,0 +196,0 @@ constructor(contract, astNode) {

@@ -74,2 +74,18 @@ "use strict";

});
ava_1.default('grouped inherited items', t => {
const solcOutput = new solc_1.SolcOutputBuilder()
.file('Foo.sol')
.contract('Foo')
.function('foo-test')
.contract('Bar')
.function('bar-test')
.contract('Child', 'Foo', 'Bar');
const source = buildSource(solcOutput);
const child = source.contracts[2];
t.is(child.name, 'Child');
const items = child.inheritedItems;
t.is(items.length, 3);
t.is(items[1].contract.name, 'Foo');
t.is(items[1].functions[0].name, 'foo-test');
});
//# sourceMappingURL=solidity.test.js.map

15

package.json
{
"name": "solidity-docgen",
"version": "0.3.4",
"version": "0.3.5",
"description": "Solidity API documentation automatic generator.",

@@ -16,2 +16,3 @@ "bin": {

"build:watch": "tsc --watch",
"coverage": "nyc --reporter=lcov npm test",
"test": "tsc && ava",

@@ -28,3 +29,3 @@ "test:watch": "concurrently -krs first -n ava,tsc 'ava --watch' 'tsc --watch --preserveWatchOutput'",

"fs-extra": "^8.1.0",
"globby": "^9.2.0",
"globby": "^10.0.1",
"handlebars": "^4.4.0",

@@ -35,6 +36,6 @@ "json5": "^2.1.0",

"semver": "^6.3.0",
"solc": "^0.5.12",
"typescript": "^3.6.3"
"solc": "^0.5.12"
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^0.1.3",
"@types/fs-extra": "^8.0.0",

@@ -47,3 +48,7 @@ "@types/json5": "0.0.30",

"ava": "^2.4.0",
"concurrently": "^4.1.2"
"code-style": "github:OpenZeppelin/code-style",
"codecov": "^3.6.1",
"concurrently": "^5.0.0",
"nyc": "^14.1.1",
"typescript": "^3.6.3"
},

@@ -50,0 +55,0 @@ "keywords": [

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc