# deal-array-property

> 根据数组的某一项键值 返回 另一项键值 例如根据id 返回其他属性

Latest version **1.0.1** (published 2019-10-28) · ISC license · 0 weekly downloads

## Install

```sh
npm install deal-array-property
pnpm add deal-array-property
yarn add deal-array-property
bun add deal-array-property
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2019-10-28 |
| First published | 2019-10-23 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | hongkunyue |
| Maintainers | hongkunyue |
| Keywords | 数组, 根据id或其他属性, 返回另一项属性 |

## Links

- npm: https://www.npmjs.com/package/deal-array-property
- npm.io page: https://npm.io/package/deal-array-property

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2019-10-28
- 1.0.0 — 2019-10-23

## README

一个根据数组对象的属性返回另一个属性的通用方法。 --作者：洪坤越
    1.0.1新增 获取整个对象的方法


     npm i deal-array-property 
     import tool from 'deal-array-property'
     该方法接受四个参数
     第一个参数：要处理的数组；
     第二个参数：要依赖的属性
     第三个参数：要依赖的属性的值
     第四个参数：要得到返回的属性的值
     let arr=[{id:12,name:'洪坤越',age:26},{id:13,name:'张三',age:27},{id:15,name:'李四',age:29},]
     
     console.log(tool.getProperty(arr,'id',12, 'age'     ))  //根据id查询age     返回的age值是26
     console.log(tool.getProperty(arr,'name', '李四', 'age')) //根据name查询age  返回的age值是29
      
    1.0.1新增
    console.log(tool.getObj(arr,'id',12))   //根据属性返回 整个对象  // {id:12,name:'洪坤越',age:26}

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