MCPcopy Index your code
hub / github.com/callstack/agent-device / matchesPlatformSelector

Function matchesPlatformSelector

src/kernel/device.ts:154–165  ·  view source on GitHub ↗
(
  device: Pick<DeviceInfo, 'platform' | 'appleOs'>,
  selector: PlatformSelector | undefined,
)

Source from the content-addressed store, hash-verified

152}
153
154export function matchesPlatformSelector(
155 device: Pick<DeviceInfo, 'platform' | 'appleOs'>,
156 selector: PlatformSelector | undefined,
157): boolean {
158 if (!selector) return true;
159 if (selector === 'apple') return isApplePlatform(device.platform);
160 // Legacy leaf selectors resolve within the collapsed `apple` platform via `appleOs`,
161 // preserving the pre-collapse `--platform ios|macos` device sets exactly.
162 if (selector === 'ios') return isApplePlatform(device.platform) && !isMacOs(device);
163 if (selector === 'macos') return isApplePlatform(device.platform) && isMacOs(device);
164 return device.platform === selector;
165}
166
167export function resolveApplePlatformName(
168 platformOrTarget: ApplePlatform | DeviceTarget | undefined,

Callers 7

device.test.tsFile · 0.90
matchesRequestedPlatformFunction · 0.90
isShardDeviceCandidateFunction · 0.90
matchesDeviceSelectorFunction · 0.85

Calls 2

isApplePlatformFunction · 0.85
isMacOsFunction · 0.85

Tested by

no test coverage detected