From c7dc8a9091f19cabcc349b0001171a49a607000c Mon Sep 17 00:00:00 2001 From: Chad Ostrowski <221614+chadoh@users.noreply.github.com> Date: Wed, 7 Oct 2020 20:01:12 -0400 Subject: [PATCH] refactor(contract): address TS linter complaints add stronger typing to `nameFunction` --- src/contract.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/contract.ts b/src/contract.ts index 94b8d192f8..cca2cd5dfe 100644 --- a/src/contract.ts +++ b/src/contract.ts @@ -4,9 +4,9 @@ import { getTransactionLastResult } from './providers'; import { PositionalArgsError, ArgumentTypeError } from './utils/errors'; // Makes `function.name` return given name -function nameFunction(name, body) { +function nameFunction(name: string, body: (args?: any[]) => {}) { return { - [name](...args) { + [name](...args: any[]) { return body(...args); } }[name];