performant-array-to-tree

v1.1.2
Converts an array of items with ids and parent ids to a nested tree in a performant `O(n)` way. Runs in browsers and node.

preversion

yarn && npm run lint && npm run build && npm run test-and-send-cov-to-coveralls

version

git add .

postversion

git push && git push --tags

build

rm -rf build && tsc && npm run uglify

lint

rm -rf build && tslint --type-check --project tsconfig.json './src/**/*.ts'

test-spec

mocha build/**/*.spec.js -R spec --bail

test-cov

istanbul cover node_modules/mocha/bin/_mocha -- build/**/*.spec.js -R spec --bail

test-and-send-cov-to-coveralls

istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- build/**/*.spec.js -R spec --bail && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js

test-remap

remap-istanbul -i coverage/coverage.json -o coverage -t html

test

npm run build && npm run test-cov && npm run test-remap

uglify

uglifyjs build/arrayToTree.js --compress --mangle --output build/arrayToTree.min.js

Metadata

  • MIT
  • Whatever
  • Philip Stanislaus
  • released 10/10/2017

Downloads

Maintainers