0.3.1 • Published 2 years ago

@oceanfe/flatten-path v0.3.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

flatten-path

npm version

how to use

import { makeTree, flatten } from '@al-c/flatten-path';

const data = [
  `packages.json`,
  `readme.md`,
  `src/components/hold/a/a/a.js`,
  `src/components/hold/a/a/b.js`,
  `src/components/hold/b/a/b.js`,
  `src/components/kiss/a/b.js`,
  `src/components/kiss/b/a.js`,
  `src/components/a/b.js`,
  `src/another/components/a/b.js`,
  `utils/a/b.js`,
  `utils/b/b.js`,
];

console.log(flatten(data));

console.log(makeTree(data));