Internal library of helpers for manipulating objects.
function isEmpty<T>(obj): obj is Exclude<unknown, T>
Check if an object contains key/value records.
• T extends Record
<string
, unknown
>
• obj: unknown
the key/value record object.
obj is Exclude<unknown, T>
false
if the object is a valid k/v set of records, else true
.
import { isEmpty } from '@graphql-markdown/utils/object';
const obj = {
bool: true,
string: "test",
number: 123,
array: ["one", "two"],
child: { key: "value" },
};
isEmpty(obj); // Returns false
isEmpty({}); // Returns true