aboutsummaryrefslogtreecommitdiffstats
path: root/packages/utils
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-05-14 16:36:13 +0800
committerGitHub <noreply@github.com>2018-05-14 16:36:13 +0800
commit58fa35641d3016ef106496c929e48febcf827dc6 (patch)
tree3f33c2faac3b55e52098ab0b5b9883a9b62f5aee /packages/utils
parent6aed4fb1ae27dabed027c855f2cbdc0bfb4f3b6b (diff)
parentb74957acdfc8d67d154bcb4698acd7575db7cc47 (diff)
downloaddexon-0x-contracts-58fa35641d3016ef106496c929e48febcf827dc6.tar.gz
dexon-0x-contracts-58fa35641d3016ef106496c929e48febcf827dc6.tar.zst
dexon-0x-contracts-58fa35641d3016ef106496c929e48febcf827dc6.zip
Merge pull request #585 from 0xProject/feature/typedef
Add missing type definitions. Enable typedef linter rule
Diffstat (limited to 'packages/utils')
-rw-r--r--packages/utils/src/abi_decoder.ts2
-rw-r--r--packages/utils/src/interval_utils.ts8
2 files changed, 7 insertions, 3 deletions
diff --git a/packages/utils/src/abi_decoder.ts b/packages/utils/src/abi_decoder.ts
index 150f74a15..d329f917a 100644
--- a/packages/utils/src/abi_decoder.ts
+++ b/packages/utils/src/abi_decoder.ts
@@ -17,7 +17,7 @@ import { BigNumber } from './configured_bignumber';
export class AbiDecoder {
private _savedABIs: AbiDefinition[] = [];
private _methodIds: { [signatureHash: string]: EventAbi } = {};
- private static _padZeros(address: string) {
+ private static _padZeros(address: string): string {
let formatted = address;
if (_.startsWith(formatted, '0x')) {
formatted = formatted.slice(2);
diff --git a/packages/utils/src/interval_utils.ts b/packages/utils/src/interval_utils.ts
index ebecc7015..6984bf42d 100644
--- a/packages/utils/src/interval_utils.ts
+++ b/packages/utils/src/interval_utils.ts
@@ -1,7 +1,11 @@
import * as _ from 'lodash';
export const intervalUtils = {
- setAsyncExcludingInterval(fn: () => Promise<void>, intervalMs: number, onError: (err: Error) => void) {
+ setAsyncExcludingInterval(
+ fn: () => Promise<void>,
+ intervalMs: number,
+ onError: (err: Error) => void,
+ ): NodeJS.Timer {
let locked = false;
const intervalId = setInterval(async () => {
if (locked) {
@@ -21,7 +25,7 @@ export const intervalUtils = {
clearAsyncExcludingInterval(intervalId: NodeJS.Timer): void {
clearInterval(intervalId);
},
- setInterval(fn: () => void, intervalMs: number, onError: (err: Error) => void) {
+ setInterval(fn: () => void, intervalMs: number, onError: (err: Error) => void): NodeJS.Timer {
const intervalId = setInterval(() => {
try {
fn();