Skip to content

Commit c3fbdb2

Browse files
committed
feat(@angular-devkit/core): support resetting a memory host
1 parent efd1c48 commit c3fbdb2

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

etc/api/angular_devkit/core/src/_golden-api.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -992,6 +992,7 @@ export declare class SimpleMemoryHost implements Host<{}> {
992992
list(path: Path): Observable<PathFragment[]>;
993993
read(path: Path): Observable<FileBuffer>;
994994
rename(from: Path, to: Path): Observable<void>;
995+
reset(): void;
995996
stat(path: Path): Observable<Stats<{}> | null> | null;
996997
watch(path: Path, options?: HostWatchOptions): Observable<HostWatchEvent> | null;
997998
write(path: Path, content: FileBuffer): Observable<void>;

packages/angular_devkit/core/src/virtual-fs/host/memory.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,4 +371,9 @@ export class SimpleMemoryHost implements Host<{}> {
371371
watch(path: Path, options?: HostWatchOptions): Observable<HostWatchEvent> | null {
372372
return this._watch(path, options);
373373
}
374+
375+
reset(): void {
376+
this._cache.clear();
377+
this._watchers.clear();
378+
}
374379
}

0 commit comments

Comments
 (0)