MCPcopy Index your code
hub / github.com/angular/angular-cli / commit

Function commit

packages/angular_devkit/schematics/src/sink/sink.ts:149–175  ·  view source on GitHub ↗
(tree: Tree)

Source from the content-addressed store, hash-verified

147 }
148
149 commit(tree: Tree): Observable<void> {
150 const actions = observableFrom(tree.actions);
151
152 return concat(
153 this.preCommit() || observableOf(null),
154 deferObservable(() => actions).pipe(
155 concatMap((action) => {
156 const maybeAction = this.preCommitAction(action);
157
158 if (isObservable(maybeAction) || isPromiseLike(maybeAction)) {
159 return maybeAction;
160 }
161
162 return observableOf(maybeAction || action);
163 }),
164 concatMap((action) => {
165 return concat(
166 this.commitSingleAction(action).pipe(ignoreElements()),
167 observableOf(action),
168 );
169 }),
170 concatMap((action) => this.postCommitAction(action) || observableOf(null)),
171 ),
172 deferObservable(() => this._done()),
173 deferObservable(() => this.postCommit() || observableOf(null)),
174 ).pipe(ignoreElements(), defaultIfEmpty(undefined));
175 }
176}
177
178function isPromiseLike<T, U = unknown>(value: U | PromiseLike<T>): value is PromiseLike<T> {

Callers

nothing calls this directly

Calls 2

isPromiseLikeFunction · 0.85
_doneMethod · 0.45

Tested by

no test coverage detected