@liangyanbiao/utils
v0.0.1
Published
hippo modular utilities
Downloads
2
Maintainers
Readme
@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.