MCPcopy Index your code
hub / github.com/angular/angular / compute

Method compute

packages/forms/signals/src/schema/logic.ts:160–175  ·  view source on GitHub ↗
(arg: FieldContext<any>)

Source from the content-addressed store, hash-verified

158 }
159
160 override compute(arg: FieldContext<any>): readonly TElement[] {
161 return this.fns.reduce((prev, f) => {
162 const value = f(arg);
163
164 if (value === undefined || value === IGNORED) {
165 return prev;
166 } else if (isArray(value)) {
167 return [...prev, ...(this.ignore ? value.filter((e) => !this.ignore!(e)) : value)];
168 } else {
169 if (this.ignore && this.ignore(value as TElement | TIgnore | undefined)) {
170 return prev;
171 }
172 return [...prev, value];
173 }
174 }, [] as TElement[]);
175 }
176}
177
178/** Logic that combines its individual logic function results by aggregating them in an array. */

Callers

nothing calls this directly

Calls 3

isArrayFunction · 0.90
reduceMethod · 0.80
filterMethod · 0.45

Tested by

no test coverage detected