Skip to content

Commit

Permalink
refactor(contract): address TS linter complaints
Browse files Browse the repository at this point in the history
add stronger typing to `nameFunction`
  • Loading branch information
chadoh committed Oct 8, 2020
1 parent f9f2ade commit c7dc8a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit c7dc8a9

Please sign in to comment.