0.0.1 • Published 6 months ago

@liangyanbiao/utils v0.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

@vas2t/hippo

The Lodash library exported as Node.js modules.

Installation

Using pnpm:

$ pnpm add @vas2t/hippo

In vite:

import { execArray2object } from '@vas2t/hippo';

const array = [
  { id: 'dashboard', name: '看板' },
  { id: 'tableBar', name: '表格操作栏' },
  { id: 'moduleSetting', name: '模板设置' },
  { id: 'fieldSetting', name: '字段设置' },
  { id: 'guide', name: '功能引导' },
];
// 普通属性形式
const result1 = execArray2object(array, 'id');
// 自定义key
const result2 = execArray2object(array, (item) => {
  return `${item.id}${item.name}`;
});

See the package source for more details.