Skip to content

Commit 2d790c4

Browse files
committed
fix: enhance TS
1 parent 0913c3e commit 2d790c4

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/generate.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,10 @@ import type { Options, TreeNode } from './type'
44

55
const lastDirStack: boolean[] = []
66

7-
export function generate(
8-
data: TreeNode['children'],
9-
options: Options,
10-
deep = 0
11-
) {
7+
export function generate(data: TreeNode[], options: Options, deep = 0) {
128
let output = ''
139

14-
data!.forEach((item, index) => {
10+
data.forEach((item, index) => {
1511
let isParentAllLeaf = false
1612
if (lastDirStack.length === 1) {
1713
isParentAllLeaf = lastDirStack[0]

0 commit comments

Comments
 (0)