Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/polkadot/util/is/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.17/util/is/index.ts";

Examples

import { isJsonObject } from 'https://deno.land/x/polkadot@0.2.17/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