File tree Expand file tree Collapse file tree
packages/angular_devkit/core/src/virtual-fs/host Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ export interface ReadonlyHost<StatsT extends object = {}> {
5959 isFile ( path : Path ) : Observable < boolean > ;
6060
6161 // Some hosts may not support stats.
62- stat ( path : Path ) : Observable < Stats < StatsT > > | null ;
62+ stat ( path : Path ) : Observable < Stats < StatsT > | null > | null ;
6363}
6464
6565export interface Host < StatsT extends object = { } > extends ReadonlyHost < StatsT > {
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ export interface SimpleMemoryHostStats {
3838}
3939
4040export class SimpleMemoryHost implements Host < { } > {
41- protected readonly _cache = new Map < Path , Stats < SimpleMemoryHostStats > > ( ) ;
41+ protected _cache = new Map < Path , Stats < SimpleMemoryHostStats > > ( ) ;
4242 private _watchers = new Map < Path , [ HostWatchOptions , Subject < HostWatchEvent > ] [ ] > ( ) ;
4343
4444 protected _newDirStats ( ) {
@@ -257,11 +257,11 @@ export class SimpleMemoryHost implements Host<{}> {
257257 return maybeStats ? maybeStats . isFile ( ) : false ;
258258 }
259259
260- protected _stat ( path : Path ) : Stats < SimpleMemoryHostStats > {
260+ protected _stat ( path : Path ) : Stats < SimpleMemoryHostStats > | null {
261261 const maybeStats = this . _cache . get ( this . _toAbsolute ( path ) ) ;
262262
263263 if ( ! maybeStats ) {
264- throw new FileDoesNotExistException ( path ) ;
264+ return null ;
265265 } else {
266266 return maybeStats ;
267267 }
@@ -343,8 +343,8 @@ export class SimpleMemoryHost implements Host<{}> {
343343 }
344344
345345 // Some hosts may not support stat.
346- stat ( path : Path ) : Observable < Stats < { } > > {
347- return new Observable < Stats < { } > > ( obs => {
346+ stat ( path : Path ) : Observable < Stats < { } > | null > | null {
347+ return new Observable < Stats < { } > | null > ( obs => {
348348 obs . next ( this . _stat ( path ) ) ;
349349 obs . complete ( ) ;
350350 } ) ;
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ export class SyncDelegateHost<T extends object = {}> {
9393
9494 // Some hosts may not support stat.
9595 stat ( path : Path ) : Stats < T > | null {
96- const result : Observable < Stats < T > > | null = this . _delegate . stat ( path ) ;
96+ const result : Observable < Stats < T > | null > | null = this . _delegate . stat ( path ) ;
9797
9898 if ( result ) {
9999 return this . _doSyncCall ( result ) ;
Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ export class TestHost extends SimpleMemoryHost {
116116
117117 return super . _isFile ( path ) ;
118118 }
119- protected _stat ( path : Path ) : Stats < SimpleMemoryHostStats > {
119+ protected _stat ( path : Path ) : Stats < SimpleMemoryHostStats > | null {
120120 this . _records . push ( { kind : 'stat' , path } ) ;
121121
122122 return super . _stat ( path ) ;
You can’t perform that action at this time.
0 commit comments