aboutsummaryrefslogtreecommitdiffstats
path: root/packages/abi-gen
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-01-04 21:53:38 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-01-04 21:53:38 +0800
commitc49f68ef3ebb11f779868b35f938c1d1cb08c665 (patch)
tree956cc24a95bfe53d9f244af1d79e728f44458a58 /packages/abi-gen
parentd0f66f86243ed958908b1c1d02a04e120c37cf71 (diff)
downloaddexon-sol-tools-c49f68ef3ebb11f779868b35f938c1d1cb08c665.tar
dexon-sol-tools-c49f68ef3ebb11f779868b35f938c1d1cb08c665.tar.gz
dexon-sol-tools-c49f68ef3ebb11f779868b35f938c1d1cb08c665.tar.bz2
dexon-sol-tools-c49f68ef3ebb11f779868b35f938c1d1cb08c665.tar.lz
dexon-sol-tools-c49f68ef3ebb11f779868b35f938c1d1cb08c665.tar.xz
dexon-sol-tools-c49f68ef3ebb11f779868b35f938c1d1cb08c665.tar.zst
dexon-sol-tools-c49f68ef3ebb11f779868b35f938c1d1cb08c665.zip
Fix linter errors
Diffstat (limited to 'packages/abi-gen')
-rw-r--r--packages/abi-gen/src/utils.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/packages/abi-gen/src/utils.ts b/packages/abi-gen/src/utils.ts
index 764daa142..f407ae23d 100644
--- a/packages/abi-gen/src/utils.ts
+++ b/packages/abi-gen/src/utils.ts
@@ -10,7 +10,7 @@ export const utils = {
if (solType.match(trailingArrayRegex)) {
const arrayItemSolType = solType.replace(trailingArrayRegex, '');
const arrayItemTsType = utils.solTypeToTsType(paramKind, arrayItemSolType);
- const arrayTsType = `(${arrayItemTsType})[]`;
+ const arrayTsType = utils.isUnionType(arrayItemTsType) ? `Array<${arrayItemTsType}>` : `${arrayItemTsType}[]`;
return arrayTsType;
} else {
const solTypeRegexToTsType = [
@@ -37,6 +37,9 @@ export const utils = {
throw new Error(`Unknown Solidity type found: ${solType}`);
}
},
+ isUnionType(tsType: string): boolean {
+ return tsType === 'number|BigNumber';
+ },
log(...args: any[]): void {
console.log(...args); // tslint:disable-line:no-console
},