BREAKING CHANGE: rename Deno.fsEvents() to Deno.watchFs() (#4886)

This commit is contained in:
Bartek Iwańczuk 2020-04-24 23:40:29 +02:00 committed by GitHub
parent 6a37e4426e
commit 824329f0da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 20 deletions

View file

@ -7,7 +7,7 @@ export interface FsEvent {
paths: string[];
}
class FsEvents implements AsyncIterableIterator<FsEvent> {
class FsWatcher implements AsyncIterableIterator<FsEvent> {
readonly rid: number;
constructor(paths: string[], options: { recursive: boolean }) {
@ -31,9 +31,9 @@ class FsEvents implements AsyncIterableIterator<FsEvent> {
}
}
export function fsEvents(
export function watchFs(
paths: string | string[],
options = { recursive: true }
): AsyncIterableIterator<FsEvent> {
return new FsEvents(Array.isArray(paths) ? paths : [paths], options);
return new FsWatcher(Array.isArray(paths) ? paths : [paths], options);
}