---
title: isEmptyObject
nav:
  title: Tools
  path: /tools
group:
  title: Types
toc: content
---

## isEmptyObject

Demo:

```tsx
/**
 * title: 基础用法
 * description: 判断数据是否为空对象
 */

import React from 'react';
import { isEmptyObject } from 'aim-tools';

const result1 = isEmptyObject({ name: 'admin' });
const result2 = isEmptyObject({});
const result3 = isEmptyObject('This is a string');

export default () => (
  <pre>
    <code>
      isEmptyObject({"{name: 'admin'}"}); // {result1.toString()}
      <br />
      <br />
      isEmptyObject({'{}'}); // {result2.toString()}
      <br />
      <br />
      isEmptyObject("This is a string"); // {result3.toString()}
    </code>
  </pre>
);
```

### API

```typescript
isEmptyObject(obj: any);
```

### Params

| 参数 | 说明           | 类型 | 默认值 | 必填 |
| :--- | :------------- | :--- | :----- | :--- |
| obj  | 需要判断的数据 | any  | -      | 是   |

### Returns

| 返回值 | 说明                                       |
| :----- | :----------------------------------------- |
| true   | 该数据是空的对象                           |
| false  | 该数据不是 Object 类型 或 不是一个空的对象 |
