UNPKG

512 BJavaScriptView Raw
1// Copyright 2017-2022 @polkadot/util authors & contributors
2// SPDX-License-Identifier: Apache-2.0
3// eslint-disable-next-line @typescript-eslint/ban-types
4
5/**
6 * @name isFunction
7 * @summary Tests for a `function`.
8 * @description
9 * Checks to see if the input value is a JavaScript function.
10 * @example
11 * <BR>
12 *
13 * ```javascript
14 * import { isFunction } from '@polkadot/util';
15 *
16 * isFunction(() => false); // => true
17 * ```
18 */
19export function isFunction(value) {
20 return typeof value === 'function';
21}
\No newline at end of file