MCPcopy Create free account
hub / github.com/devcontainers/cli / parseBytes

Function parseBytes

src/spec-node/imageMetadata.ts:253–262  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

251}
252
253function parseBytes(str: string) {
254 const m = /^(\d+)([tgmk]b)?$/.exec(str);
255 if (m) {
256 const [, strn, stru] = m;
257 const n = parseInt(strn, 10);
258 const u = stru && { t: 2 ** 40, g: 2 ** 30, m: 2 ** 20, k: 2 ** 10 }[stru[0]] || 1;
259 return n * u;
260 }
261 return 0;
262}
263
264function mergeMounts(imageMetadata: ImageMetadataEntry[]): (Mount | string)[] | undefined {
265 const seen = new Set<string>();

Callers 2

mergeHostRequirementsFunction · 0.85
mergeGpuRequirementsFunction · 0.85

Calls 1

execMethod · 0.65

Tested by

no test coverage detected