aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sol-doc/src
diff options
context:
space:
mode:
authorF. Eugene Aumson <gene@aumson.org>2018-09-18 07:03:44 +0800
committerF. Eugene Aumson <gene@aumson.org>2018-09-18 07:31:47 +0800
commit30622631ff588b4b87a05e4ce3ca2906ed1edf9f (patch)
tree1b798115e8565ee2d760878b8e0af54936c17518 /packages/sol-doc/src
parent4bab402e95fd2242ad3a472e2b5076c5026da50a (diff)
downloaddexon-sol-tools-30622631ff588b4b87a05e4ce3ca2906ed1edf9f.tar
dexon-sol-tools-30622631ff588b4b87a05e4ce3ca2906ed1edf9f.tar.gz
dexon-sol-tools-30622631ff588b4b87a05e4ce3ca2906ed1edf9f.tar.bz2
dexon-sol-tools-30622631ff588b4b87a05e4ce3ca2906ed1edf9f.tar.lz
dexon-sol-tools-30622631ff588b4b87a05e4ce3ca2906ed1edf9f.tar.xz
dexon-sol-tools-30622631ff588b4b87a05e4ce3ca2906ed1edf9f.tar.zst
dexon-sol-tools-30622631ff588b4b87a05e4ce3ca2906ed1edf9f.zip
use Array.join rather than string concatenation
Diffstat (limited to 'packages/sol-doc/src')
-rw-r--r--packages/sol-doc/src/solidity_doc_generator.ts12
1 files changed, 5 insertions, 7 deletions
diff --git a/packages/sol-doc/src/solidity_doc_generator.ts b/packages/sol-doc/src/solidity_doc_generator.ts
index 6c67f921d..78c56e7fa 100644
--- a/packages/sol-doc/src/solidity_doc_generator.ts
+++ b/packages/sol-doc/src/solidity_doc_generator.ts
@@ -231,8 +231,6 @@ function _genMethodParamsDoc(
devdocIfExists: DevdocOutput | undefined,
): { parameters: Parameter[]; methodSignature: string } {
const parameters: Parameter[] = [];
- let methodSignature = `${name}(`;
-
for (const abiParam of abiParams) {
const parameter: Parameter = {
name: abiParam.name,
@@ -241,13 +239,13 @@ function _genMethodParamsDoc(
type: { name: abiParam.type, typeDocType: TypeDocTypes.Intrinsic },
};
parameters.push(parameter);
- methodSignature = `${methodSignature}${abiParam.type},`;
}
- if (methodSignature.slice(-1) === ',') {
- methodSignature = methodSignature.slice(0, -1);
- }
- methodSignature += ')';
+ const methodSignature = `${name}(${abiParams
+ .map(abiParam => {
+ return abiParam.type;
+ })
+ .join(',')})`;
if (!_.isUndefined(devdocIfExists)) {
const devdocMethodIfExists = devdocIfExists.methods[methodSignature];