@polkadot/util
Version:
A collection of useful utilities for @polkadot
27 lines (24 loc) • 551 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isBoolean = isBoolean;
// 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
* ```
*/
function isBoolean(value) {
return typeof value === 'boolean';
}