diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-01-05 01:56:30 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-01-10 18:24:31 +0800 |
commit | 27d9fba785a5a53550be53b12baf9069bda8d160 (patch) | |
tree | bde34d668e53832dd03dd279992721d56291124b /packages/assert/src | |
parent | e6a783aff803c276392efec93571d24fc96feb6e (diff) | |
download | dexon-0x-contracts-27d9fba785a5a53550be53b12baf9069bda8d160.tar dexon-0x-contracts-27d9fba785a5a53550be53b12baf9069bda8d160.tar.gz dexon-0x-contracts-27d9fba785a5a53550be53b12baf9069bda8d160.tar.bz2 dexon-0x-contracts-27d9fba785a5a53550be53b12baf9069bda8d160.tar.lz dexon-0x-contracts-27d9fba785a5a53550be53b12baf9069bda8d160.tar.xz dexon-0x-contracts-27d9fba785a5a53550be53b12baf9069bda8d160.tar.zst dexon-0x-contracts-27d9fba785a5a53550be53b12baf9069bda8d160.zip |
Include web3 types via typeRoots and factor out common parts of tsconfig.json
Diffstat (limited to 'packages/assert/src')
-rw-r--r-- | packages/assert/src/index.ts | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/packages/assert/src/index.ts b/packages/assert/src/index.ts index 051a741c5..56f663780 100644 --- a/packages/assert/src/index.ts +++ b/packages/assert/src/index.ts @@ -18,9 +18,6 @@ export const assert = { `${variableName} should be in baseUnits (no decimals), found value: ${value.toNumber()}`, ); }, - isUndefined(value: any, variableName?: string): void { - this.assert(_.isUndefined(value), this.typeAssertionMessage(variableName, 'undefined', value)); - }, isString(variableName: string, value: string): void { this.assert(_.isString(value), this.typeAssertionMessage(variableName, 'string', value)); }, @@ -77,11 +74,11 @@ Validation errors: ${validationResult.errors.join(', ')}`; this.assert(!hasValidationErrors, msg); }, isHttpUrl(variableName: string, value: any): void { - const isValidUrl = validUrl.isWebUri(value); + const isValidUrl = !_.isUndefined(validUrl.isWebUri(value)); this.assert(isValidUrl, this.typeAssertionMessage(variableName, 'http url', value)); }, isUri(variableName: string, value: any): void { - const isValidUri = validUrl.isUri(value); + const isValidUri = !_.isUndefined(validUrl.isUri(value)); this.assert(isValidUri, this.typeAssertionMessage(variableName, 'uri', value)); }, assert(condition: boolean, message: string): void { |