UNPKG

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