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

Function unionOrUndefined

src/spec-node/imageMetadata.ts:280–283  ·  view source on GitHub ↗
(entries: (T[] | undefined)[])

Source from the content-addressed store, hash-verified

278}
279
280function unionOrUndefined<T>(entries: (T[] | undefined)[]): T[] | undefined {
281 const values = [...new Set(([] as T[]).concat(...entries.filter(entry => !!entry) as T[][]))];
282 return values.length ? values : undefined;
283}
284
285function collectOrUndefined<T, K extends keyof T>(entries: T[], property: K): NonNullable<T[K]>[] | undefined {
286 const values = entries.map(entry => entry[property])

Callers 1

mergeConfigurationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected