MCPcopy Create free account
hub / github.com/angular/angular / getArray

Method getArray

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

* Returns an array of `AstValue` objects parsed from the property called `propertyName`. * * Throws an error if there is no such property or the property is not an array.

(
    this: ConformsTo<this, T[K], unknown[]>,
    propertyName: K,
  )

Source from the content-addressed store, hash-verified

134 * Throws an error if there is no such property or the property is not an array.
135 */
136 getArray<K extends PropertyKey<T>>(
137 this: ConformsTo<this, T[K], unknown[]>,
138 propertyName: K,
139 ): AstValue<ArrayValueType<T[K]>, TExpression>[] {
140 const arr = this.host.parseArrayLiteral(this.getRequiredProperty(propertyName));
141 return arr.map((entry) => new AstValue<ArrayValueType<T[K]>, TExpression>(entry, this.host));
142 }
143
144 /**
145 * Returns a `WrappedNodeExpr` object that wraps the expression at the property called

Callers

nothing calls this directly

Calls 3

getRequiredPropertyMethod · 0.95
mapMethod · 0.80
parseArrayLiteralMethod · 0.65

Tested by

no test coverage detected