(
object: {[key: string]: T},
mapper: (value: T) => o.Expression,
)
| 40 | * any keys. |
| 41 | */ |
| 42 | export function toOptionalLiteralMap<T>( |
| 43 | object: {[key: string]: T}, |
| 44 | mapper: (value: T) => o.Expression, |
| 45 | ): o.LiteralMapExpr | null { |
| 46 | const entries = Object.keys(object).map((key) => { |
| 47 | const value = object[key]; |
| 48 | return {key, value: mapper(value), quoted: true}; |
| 49 | }); |
| 50 | |
| 51 | if (entries.length > 0) { |
| 52 | return o.literalMap(entries); |
| 53 | } else { |
| 54 | return null; |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | export function compileDependencies( |
| 59 | deps: R3DependencyMetadata[] | 'invalid' | null, |
no test coverage detected
searching dependent graphs…