diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-05-30 18:00:51 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-05-30 18:00:51 +0800 |
commit | 95b78d877a1b231d5df2e75447c97b643da4fdaa (patch) | |
tree | 5c218a7b67b74f6990441b4f03394030a2d1b3ef /src | |
parent | 699e588d1fda7f7e8190a4b3347905964cef2d95 (diff) | |
download | dexon-sol-tools-95b78d877a1b231d5df2e75447c97b643da4fdaa.tar dexon-sol-tools-95b78d877a1b231d5df2e75447c97b643da4fdaa.tar.gz dexon-sol-tools-95b78d877a1b231d5df2e75447c97b643da4fdaa.tar.bz2 dexon-sol-tools-95b78d877a1b231d5df2e75447c97b643da4fdaa.tar.lz dexon-sol-tools-95b78d877a1b231d5df2e75447c97b643da4fdaa.tar.xz dexon-sol-tools-95b78d877a1b231d5df2e75447c97b643da4fdaa.tar.zst dexon-sol-tools-95b78d877a1b231d5df2e75447c97b643da4fdaa.zip |
Add isBoolean assertion
Diffstat (limited to 'src')
-rw-r--r-- | src/utils/assert.ts | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/utils/assert.ts b/src/utils/assert.ts index 1baf572d1..aeed1c6dc 100644 --- a/src/utils/assert.ts +++ b/src/utils/assert.ts @@ -27,6 +27,9 @@ export const assert = { isNumber(variableName: string, value: number): void { this.assert(_.isFinite(value), this.typeAssertionMessage(variableName, 'number', value)); }, + isBoolean(variableName: string, value: boolean): void { + this.assert(_.isBoolean(value), this.typeAssertionMessage(variableName, 'boolean', value)); + }, doesConformToSchema(variableName: string, value: object, schema: Schema): void { const schemaValidator = new SchemaValidator(); const validationResult = schemaValidator.validate(value, schema); |