@polkadot/util
Version:
A collection of useful utilities for @polkadot
20 lines (19 loc) • 446 B
JavaScript
// Copyright 2017-2022 @polkadot/util authors & contributors
// SPDX-License-Identifier: Apache-2.0
/**
* @name isBoolean
* @summary Tests for a boolean value.
* @description
* Checks to see if the input value is a JavaScript boolean.
* @example
* <BR>
*
* ```javascript
* import { isBoolean } from '@polkadot/util';
*
* isBoolean(false); // => true
* ```
*/
export function isBoolean(value) {
return typeof value === 'boolean';
}