* 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)
| 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)) { |
no test coverage detected