UNPKG

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