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

Method toMap

packages/compiler-cli/linker/src/ast/ast_value.ts:193–199  ·  view source on GitHub ↗

* Converts the AstObject to a JavaScript Map, mapping each property value (as an * `AstValue`) to the generic type (`T`) via the `mapper` function.

(mapper: (value: AstValue<ObjectValueType<T>, TExpression>) => V)

Source from the content-addressed store, hash-verified

191 * `AstValue`) to the generic type (`T`) via the `mapper` function.
192 */
193 toMap<V>(mapper: (value: AstValue<ObjectValueType<T>, TExpression>) => V): Map<string, V> {
194 const result = new Map<string, V>();
195 for (const [key, expression] of this.obj) {
196 result.set(key, mapper(new AstValue<ObjectValueType<T>, TExpression>(expression, this.host)));
197 }
198 return result;
199 }
200
201 private getRequiredProperty(propertyName: PropertyKey<T>): TExpression {
202 if (!this.obj.has(propertyName)) {

Callers 2

ast_value_spec.tsFile · 0.80
toR3ComponentMetaMethod · 0.80

Calls 1

setMethod · 0.65

Tested by

no test coverage detected