diff --git a/source/lib/index.ts b/source/lib/index.ts index 7818825..7c1fb77 100644 --- a/source/lib/index.ts +++ b/source/lib/index.ts @@ -1150,7 +1150,7 @@ async function _parseTreeAsync(children: Dree[], prefix: string, options: ParseO * @return {object} The directory tree as a Dree object * @template Node The type of the tree object, which can be extended and changed by the onFile and onDir functions. */ -export function scan(path: string, options?: ScanOptions, onFile?: Callback, onDir?: Callback): Node { +export function scan(path: string, options?: ScanOptions, onFile?: Callback, onDir?: Callback): Node | null { const opt = mergeScanOptions(options); const root = resolvePath(path, opt); const result = _scan(root, root, 0, opt, onFile, onDir);