(devContainerMetadata: SubstitutedConfig<ImageMetadataEntry[]>)
| 493 | } |
| 494 | |
| 495 | export function getDevcontainerMetadataLabel(devContainerMetadata: SubstitutedConfig<ImageMetadataEntry[]>) { |
| 496 | const metadata = devContainerMetadata.raw; |
| 497 | if (!metadata.length) { |
| 498 | return ''; |
| 499 | } |
| 500 | const imageMetadataLabelValue = `[${metadata |
| 501 | .map(feature => ` \\\n${toLabelString(feature)}`) |
| 502 | .join(',')} \\\n]`; |
| 503 | return `LABEL ${imageMetadataLabel}="${imageMetadataLabelValue}"`; |
| 504 | } |
| 505 | |
| 506 | function toLabelString(obj: object) { |
| 507 | return JSON.stringify(obj) |
no test coverage detected