We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0913c3e commit 2d790c4Copy full SHA for 2d790c4
src/generate.ts
@@ -4,14 +4,10 @@ import type { Options, TreeNode } from './type'
4
5
const lastDirStack: boolean[] = []
6
7
-export function generate(
8
- data: TreeNode['children'],
9
- options: Options,
10
- deep = 0
11
-) {
+export function generate(data: TreeNode[], options: Options, deep = 0) {
12
let output = ''
13
14
- data!.forEach((item, index) => {
+ data.forEach((item, index) => {
15
let isParentAllLeaf = false
16
if (lastDirStack.length === 1) {
17
isParentAllLeaf = lastDirStack[0]
0 commit comments