UNPKG

amos-tool

Version:

amos ui tool

83 lines (51 loc) 783 B
## amos-tool ##useage npm install --save amos-tool ## keywords * amos ui * amos tool ## api * array2tree * arrayFilter * browerSupport ```js import { array2tree } from 'amos-tool'; const data = [{ value: 'a', children: [{ value: 'b', children: [{ value: 'c' }, { value: 'd', }] }], }]; const values = ['a', 'b', 'c']; const result = array2tree( data, (item, level) => item.value === values[level] ); console.log(result); // [ // { value: 'a', children: [...] }, // { value: 'b', children: [...] }, // { value: 'c', children: [...] } // ] ``` ```js **Base64: encode: decode: **parseJson: **Queue: **stringify: **supportWs: **trim: **UUID: **array2tree: **arrayFilter: **browerSupport: **Log: **Store: