* Converts the AstObject to a raw JavaScript object, mapping each property value (as an * `AstValue`) to the generic type (`T`) via the `mapper` function.
(
mapper: (value: AstValue<ObjectValueType<T>, TExpression>, key: string) => V,
)
| 174 | * `AstValue`) to the generic type (`T`) via the `mapper` function. |
| 175 | */ |
| 176 | toLiteral<V>( |
| 177 | mapper: (value: AstValue<ObjectValueType<T>, TExpression>, key: string) => V, |
| 178 | ): Record<string, V> { |
| 179 | const result: Record<string, V> = {}; |
| 180 | for (const [key, expression] of this.obj) { |
| 181 | result[key] = mapper( |
| 182 | new AstValue<ObjectValueType<T>, TExpression>(expression, this.host), |
| 183 | key, |
| 184 | ); |
| 185 | } |
| 186 | return result; |
| 187 | } |
| 188 | |
| 189 | /** |
| 190 | * Converts the AstObject to a JavaScript Map, mapping each property value (as an |
no outgoing calls
no test coverage detected