UNPKG

792 BTypeScriptView Raw
1interface ObjectIndexed {
2 [index: string]: any;
3}
4/**
5 * @name isJsonObject
6 * @summary Tests for a valid JSON `object`.
7 * @description
8 * Checks to see if the input value is a valid JSON object.
9 * It returns false if the input is JSON parsable, but not an Javascript object.
10 * @example
11 * <BR>
12 *
13 * ```javascript
14 * import { isJsonObject } from '@polkadot/util';
15 *
16 * isJsonObject({}); // => true
17 * isJsonObject({
18 * "Test": "1234",
19 * "NestedTest": {
20 * "Test": "5678"
21 * }
22 * }); // => true
23 * isJsonObject(1234); // JSON parsable, but not an object => false
24 * isJsonObject(null); // JSON parsable, but not an object => false
25 * isJsonObject('not an object'); // => false
26 * ```
27 */
28export declare function isJsonObject(value: unknown): value is ObjectIndexed;
29export {};