diff options
Diffstat (limited to 'packages/utils')
-rw-r--r-- | packages/utils/README.md | 18 | ||||
-rw-r--r-- | packages/utils/package.json | 5 | ||||
-rw-r--r-- | packages/utils/src/abi_decoder.ts | 2 | ||||
-rw-r--r-- | packages/utils/src/interval_utils.ts | 8 |
4 files changed, 14 insertions, 19 deletions
diff --git a/packages/utils/README.md b/packages/utils/README.md index 914404937..c637c9af5 100644 --- a/packages/utils/README.md +++ b/packages/utils/README.md @@ -44,28 +44,16 @@ yarn install ### Build -If this is your **first** time building this package, you must first build **all** packages within the monorepo. This is because packages that depend on other packages located inside this monorepo are symlinked when run from **within** the monorepo. This allows you to make changes across multiple packages without first publishing dependent packages to NPM. To build all packages, run the following from the monorepo root directory: +To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory: ```bash -yarn lerna:rebuild +PKG=@0xproject/utils yarn build ``` Or continuously rebuild on change: ```bash -yarn dev -``` - -You can also build this specific package by running the following from within its directory: - -```bash -yarn build -``` - -or continuously rebuild on change: - -```bash -yarn build:watch +PKG=@0xproject/utils yarn watch ``` ### Clean diff --git a/packages/utils/package.json b/packages/utils/package.json index 0924aefc3..d39077148 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,11 +1,14 @@ { "name": "@0xproject/utils", "version": "0.6.1", + "engines": { + "node" : ">=6.12" + }, "description": "0x TS utils", "main": "lib/index.js", "types": "lib/index.d.ts", "scripts": { - "build:watch": "tsc -w", + "watch": "tsc -w", "build": "tsc && copyfiles -u 2 './lib/monorepo_scripts/**/*' ./scripts", "clean": "shx rm -rf lib scripts", "lint": "tslint --project .", 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(); |