Skip to content

Commit 801f12f

Browse files
authored
Merge pull request #123 from rankida/ts-fix
Fix missing IObj definition and add test example
2 parents 0300efb + 48a89c2 commit 801f12f

File tree

3 files changed

+40
-4
lines changed

3 files changed

+40
-4
lines changed

index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ declare namespace directoryTree {
3434
depth?: number;
3535
}
3636

37-
export type DirectoryTreeCallback<TCustom extends IObj = IObj> = (
37+
export type DirectoryTreeCallback<TCustom extends Record<string, any> = Record<string, any>> = (
3838
item: DirectoryTree<TCustom>,
3939
path: string,
4040
stats: Stats

package-lock.json

Lines changed: 34 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,17 @@
2222
"command-line-usage": "^6.1.1"
2323
},
2424
"devDependencies": {
25+
"@types/node": "^18.11.17",
2526
"chai": "^2.3.0",
26-
"mocha": "^8.3.2"
27+
"mocha": "^8.3.2",
28+
"typescript": "^4.9.4"
2729
},
2830
"bin": "bin/index.js",
2931
"engines": {
3032
"node": ">=10.0"
3133
},
3234
"scripts": {
33-
"test": "mocha"
35+
"test": "mocha",
36+
"test-ts": "./node_modules/.bin/tsc index.d.ts"
3437
}
3538
}

0 commit comments

Comments
 (0)