Add isBoolean (#53)

This commit is contained in:
Jaco Greeff
2017-12-17 20:16:15 +01:00
committed by GitHub
parent 9b4070401a
commit e77d536edd
6 changed files with 69 additions and 9 deletions
+18
View File
@@ -3,6 +3,7 @@
Type checking utilities
- [isBN](#isbn) Tests for a `BN` object instance.
- [isBoolean](#isboolean) Tests for a boolean value.
- [isBuffer](#isbuffer) Tests for a `Buffer` object instance.
- [isError](#iserror) Tests for a `Error` object instance.
- [isFunction](#isfunction) Tests for a `function`.
@@ -34,6 +35,23 @@ import { isBN } from '@polkadot/util';
console.log('isBN', isBN(new BN(1))); // => true
```
## isBoolean
Tests for a boolean value.
```js
isBoolean (value: any): boolean
```
Checks to see if the input value is a JavaScript boolean.
```js
import { isBoolean } from '@polkadot/util';
isBoolean(false); // => true
```
## isBuffer
Tests for a `Buffer` object instance.