Primitives / foldkit-primitives/media

Platform

const · packages/primitives/src/media/platform.ts:8

const Platform: readonly [
  'mac',
  'windows',
  'linux',
  'android',
  'ios',
  'unknown',
]

Its type

type Platform = (typeof Platform)[number]

Platform detection as pure functions. platformFromUA reads a user-agent string (passed in, so tests pin it without stubbing globals); order matters — Android contains "Linux", iPhones mention "Mac" — so mobile checks come first. isBrowser/isServer split SSR from client for init defaults.