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

Function platformDispatch

src/spec-common/commonUtils.ts:549–554  ·  view source on GitHub ↗
(platform: NodeJS.Platform, platformSwitch: PlatformSwitch<T>)

Source from the content-addressed store, hash-verified

547export type PlatformSwitch<T> = T | { posix: T; win32: T };
548
549export function platformDispatch<T>(platform: NodeJS.Platform, platformSwitch: PlatformSwitch<T>) {
550 if (platformSwitch && typeof platformSwitch === 'object' && 'win32' in platformSwitch) {
551 return platform === 'win32' ? platformSwitch.win32 : platformSwitch.posix;
552 }
553 return platformSwitch;
554}
555
556export async function isFile(shellServer: ShellServer, location: string) {
557 return platformDispatch(shellServer.platform, {

Callers 3

execFunction · 0.90
launchFunction · 0.90
isFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected