@tomzio/utils
v0.0.6
Published
javascript utils
Downloads
16
Readme
utils
Fast, generic JavaScript/node.js utility functions.
Install with npm
$ npm i @tomzio/utils --save
Usage
import { TreeUtils } from '@tomzio/utils';
TreeUtils.iterateeTree(dataSource, (data, parent) => {
const level = parent && parent.level ? parent.level : 0
if (_.isNil(data.key) || _.trim(data.key) === "") {
data.key = BasicUtil.randomNo(8);
}
data.level = level + 1;
data.parent = parent;
});