mirror of
https://github.com/pezkuwichain/pezkuwi-common.git
synced 2026-04-22 09:08:03 +00:00
28 lines
779 B
TypeScript
28 lines
779 B
TypeScript
type ObjectIndexed = Record<string, any>;
|
|
/**
|
|
* @name isJsonObject
|
|
* @summary Tests for a valid JSON `object`.
|
|
* @description
|
|
* Checks to see if the input value is a valid JSON object.
|
|
* It returns false if the input is JSON parsable, but not an Javascript object.
|
|
* @example
|
|
* <BR>
|
|
*
|
|
* ```javascript
|
|
* import { isJsonObject } from '@pezkuwi/util';
|
|
*
|
|
* isJsonObject({}); // => true
|
|
* isJsonObject({
|
|
* "Test": "1234",
|
|
* "NestedTest": {
|
|
* "Test": "5678"
|
|
* }
|
|
* }); // => true
|
|
* isJsonObject(1234); // JSON parsable, but not an object => false
|
|
* isJsonObject(null); // JSON parsable, but not an object => false
|
|
* isJsonObject('not an object'); // => false
|
|
* ```
|
|
*/
|
|
export declare function isJsonObject(value: unknown): value is ObjectIndexed;
|
|
export {};
|