lodash-f
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

lodash-f

基于 lodash 实现上层的工具方法集

Getting Started

Install dependencies,

$ npm i

Start the dev server,

$ npm start

Build documentation,

$ npm run docs:build

Build library via father-build,

$ npm run build

findItem

findItem(array, validateKey, validateValue, [targetKey]=undefined)

“Array” 方法,根据指定的 key 和 value 循环数组得到目标数据后按规则取出,规则可不填

参数

  • array (Array): 数据源。
  • validateKey (string): 需要循环验证的 key。
  • validateValue (var): 需要循环验证的 value。
  • targetKey: 按规则取出。
import { findItem } from 'lodash-f';
 
const arr = [
  { a: 1, b: 11 },
  { a: 2, b: 22 },
];
 
findItem(arr, 'a', 2, 'b')
 
// => 22
 

Readme

Keywords

none

Package Sidebar

Install

npm i lodash-f

Weekly Downloads

7

Version

0.0.2

License

MIT

Unpacked Size

7.88 kB

Total Files

18

Last publish

Collaborators

  • karzanonline