Skip to main content
Module

x/polkadot/util/index.ts>isJsonObject

Package publishing for deno.land/x/polkadot
Go to Latest
function isJsonObject
import { isJsonObject } from "https://deno.land/x/polkadot@0.2.40/util/index.ts";

Examples

import { isJsonObject } from 'https://deno.land/x/polkadot@0.2.40/util/mod.ts';

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

Parameters

value: unknown

Returns

value is ObjectIndexed