# handle-object-empty

> 处理对象中的空值

Latest version **1.0.1** (published 2022-02-07) · ISC license · 0 weekly downloads

## Install

```sh
npm install handle-object-empty
pnpm add handle-object-empty
yarn add handle-object-empty
bun add handle-object-empty
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2022-02-07 |
| First published | 2022-02-07 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 19.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | xyg |
| Maintainers | xiangyuan |

## Links

- npm: https://www.npmjs.com/package/handle-object-empty
- npm.io page: https://npm.io/package/handle-object-empty

## Recent versions

- 1.0.1 (latest) — 2022-02-07
- 1.0.0 — 2022-02-07

## README

## 项目简介

处理对象的属性值为空的情况

## 安装

```
yarn add handle-object-empty --save
或
npm install handle-object-empty --save
```

## 使用

```javascript
import handleObjectEmpty from "handle-object-empty";
handleObjectEmpty({
  a: 1,
  b: "",
});
// {a: 1, b: undefined}
```

**请求API： handleObjectEmpty(object[,config])**

## config说明
key|说明|默认值
--|:--:|--:
defaultShowValue | 对空值属性设置默认值 | undefined
deleteKey | 对空值的属性,是否删除该属性 | false
propsDefaultValue | 可以对特定的属性设置默认值 | 无

> 注意：
> 1. deleteKey的优先级最高，当设置为true时，其他配置都不会生效。
> 2. 当在propsDefaultValue下配置了对应属性的默认值时，就不会采用defaultShowValue的值

---
_Source: https://npm.io/package/handle-object-empty · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
