From 23de3bee82fd19f2178a7179b9f649feba771210 Mon Sep 17 00:00:00 2001 From: Brendan Forster Date: Mon, 6 Mar 2017 14:35:29 +1100 Subject: [PATCH] walk and walkSync now live in different packages --- fs-extra/fs-extra-tests.ts | 32 -------------------------------- fs-extra/index.d.ts | 3 --- 2 files changed, 35 deletions(-) diff --git a/fs-extra/fs-extra-tests.ts b/fs-extra/fs-extra-tests.ts index 26ad80ffb4..f2056d3e06 100644 --- a/fs-extra/fs-extra-tests.ts +++ b/fs-extra/fs-extra-tests.ts @@ -102,35 +102,3 @@ fs.ensureSymlink(path, errorCallback); fs.ensureSymlinkSync(path); fs.emptyDir(path, errorCallback); fs.emptyDirSync(path); - -var items: string[]; -fs.walk("my-path") - .on('data', function (item) { - items.push(item.path); - }) - .on('end', function () { - console.dir(items); - }); - -const ignoreHiddenFiles = (item: string): boolean => { - const basename = Path.basename(item) - return basename === '.' || basename[0] !== '.' -} - -const sortPaths = (left: string, right: string) => left.localeCompare(right); - -const options = { - filter: ignoreHiddenFiles, - pathSorter: sortPaths -} - -fs.walk(path, options) - .on('readable', function (this: fs.PathEntryStream) { - let item: fs.PathEntry | undefined - while ((item = this.read())) { - items.push(item.path) - } - }) - .on('end', function () { - - }) diff --git a/fs-extra/index.d.ts b/fs-extra/index.d.ts index 2cc47724c8..e30426321e 100644 --- a/fs-extra/index.d.ts +++ b/fs-extra/index.d.ts @@ -120,9 +120,6 @@ export type PathEntryStream = { read(): PathEntry | null } -export function walk(path: string, options?: WalkOptions): WalkEventEmitter; -export function walkSync(path: string): ReadonlyArray; - export interface CopyFilterFunction { (src: string): boolean }