"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "packages/angular_devkit/schematics/src/sink/host.ts" between
angular-cli-12.0.3.tar.gz and angular-cli-12.0.4.tar.gz

About: Angular CLI is a command line interface for Angular.

host.ts  (angular-cli-12.0.3):host.ts  (angular-cli-12.0.4)
skipping to change at line 39 skipping to change at line 39
super(); super();
} }
protected _validateCreateAction(action: CreateFileAction): Observable<void> { protected _validateCreateAction(action: CreateFileAction): Observable<void> {
return this._force ? EMPTY : super._validateCreateAction(action); return this._force ? EMPTY : super._validateCreateAction(action);
} }
protected _validateFileExists(p: Path): Observable<boolean> { protected _validateFileExists(p: Path): Observable<boolean> {
if (this._filesToCreate.has(p) || this._filesToUpdate.has(p)) { if (this._filesToCreate.has(p) || this._filesToUpdate.has(p)) {
return observableOf(true); return observableOf(true);
} else if (this._filesToDelete.has(p)) { }
return observableOf(false);
} else if ([...this._filesToRename.values()].some(([from]) => from == p)) { if (this._filesToDelete.has(p)) {
return observableOf(false); return observableOf(false);
} else {
return this._host.exists(p);
} }
for (const [from, to] of this._filesToRename.values()) {
switch (p) {
case from:
return observableOf(false);
case to:
return observableOf(true);
}
}
return this._host.exists(p);
} }
protected _overwriteFile(path: Path, content: Buffer): Observable<void> { protected _overwriteFile(path: Path, content: Buffer): Observable<void> {
this._filesToUpdate.set(path, new UpdateBuffer(content)); this._filesToUpdate.set(path, new UpdateBuffer(content));
return EMPTY; return EMPTY;
} }
protected _createFile(path: Path, content: Buffer): Observable<void> { protected _createFile(path: Path, content: Buffer): Observable<void> {
this._filesToCreate.set(path, new UpdateBuffer(content)); this._filesToCreate.set(path, new UpdateBuffer(content));
skipping to change at line 85 skipping to change at line 94
// Really commit everything to the actual filesystem. // Really commit everything to the actual filesystem.
return concatObservables( return concatObservables(
observableFrom([...this._filesToDelete.values()]).pipe( observableFrom([...this._filesToDelete.values()]).pipe(
concatMap((path) => this._host.delete(path)), concatMap((path) => this._host.delete(path)),
), ),
observableFrom([...this._filesToRename.entries()]).pipe( observableFrom([...this._filesToRename.entries()]).pipe(
concatMap(([_, [path, to]]) => this._host.rename(path, to)), concatMap(([_, [path, to]]) => this._host.rename(path, to)),
), ),
observableFrom([...this._filesToCreate.entries()]).pipe( observableFrom([...this._filesToCreate.entries()]).pipe(
concatMap(([path, buffer]) => { concatMap(([path, buffer]) => {
return this._host.write(path, (buffer.generate() as {}) as virtualFs.F ileBuffer); return this._host.write(path, buffer.generate() as {} as virtualFs.Fil eBuffer);
}), }),
), ),
observableFrom([...this._filesToUpdate.entries()]).pipe( observableFrom([...this._filesToUpdate.entries()]).pipe(
concatMap(([path, buffer]) => { concatMap(([path, buffer]) => {
return this._host.write(path, (buffer.generate() as {}) as virtualFs.F ileBuffer); return this._host.write(path, buffer.generate() as {} as virtualFs.Fil eBuffer);
}), }),
), ),
).pipe(reduce(() => {})); ).pipe(reduce(() => {}));
} }
} }
 End of changes. 5 change blocks. 
7 lines changed or deleted 16 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)