@tomzio/utils

0.0.6 • Public • Published

utils npm version

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;
});

Readme

Keywords

Package Sidebar

Install

npm i @tomzio/utils

Weekly Downloads

1

Version

0.0.6

License

ISC

Unpacked Size

2.32 kB

Total Files

5

Last publish

Collaborators

  • tomzhou