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

Function getSafeId

src/spec-node/containerFeatures.ts:26–29  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

24// - the '_' character, and
25// - a number cannot be the first character
26export const getSafeId = (str: string) => str
27 .replace(/[^\w_]/g, '_')
28 .replace(/^[\d_]+/g, '_')
29 .toUpperCase();
30
31export async function extendImage(params: DockerResolverParameters, config: SubstitutedConfig<DevContainerConfig>, imageName: string, additionalImageNames: string[], additionalFeatures: Record<string, string | boolean | Record<string, string | boolean>>, canAddLabelsToContainer: boolean) {
32 const { common } = params;

Callers 4

execFunction · 0.90
getFeaturesBuildOptionsFunction · 0.85
getFeatureEnvVariablesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected