MCPcopy Index your code
hub / github.com/devcontainers/cli / getDevcontainerMetadataLabel

Function getDevcontainerMetadataLabel

src/spec-node/imageMetadata.ts:495–504  ·  view source on GitHub ↗
(devContainerMetadata: SubstitutedConfig<ImageMetadataEntry[]>)

Source from the content-addressed store, hash-verified

493}
494
495export 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
506function toLabelString(obj: object) {
507 return JSON.stringify(obj)

Callers 3

getImageBuildOptionsFunction · 0.90
getFeaturesBuildOptionsFunction · 0.90

Calls 1

toLabelStringFunction · 0.85

Tested by

no test coverage detected