walk and walkSync now live in different packages

This commit is contained in:
Brendan Forster
2017-03-06 14:35:29 +11:00
parent da51390667
commit 23de3bee82
2 changed files with 0 additions and 35 deletions
-32
View File
@@ -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 () {
})
-3
View File
@@ -120,9 +120,6 @@ export type PathEntryStream = {
read(): PathEntry | null
}
export function walk(path: string, options?: WalkOptions): WalkEventEmitter;
export function walkSync(path: string): ReadonlyArray<string>;
export interface CopyFilterFunction {
(src: string): boolean
}