MCPcopy Index your code
hub / github.com/nodejs/nodejs.org / getUserPlatform

Function getUserPlatform

apps/site/util/userAgent.ts:39–48  ·  view source on GitHub ↗
(
  userArchitecture: Architecture | '',
  userBitness: Bitness | ''
)

Source from the content-addressed store, hash-verified

37 * @see https://developer.mozilla.org/en-US/docs/Web/API/NavigatorUAData/getHighEntropyValues
38 */
39export const getUserPlatform = (
40 userArchitecture: Architecture | '',
41 userBitness: Bitness | ''
42): Platform => {
43 if (userArchitecture === 'arm' && userBitness === '64') {
44 return 'arm64';
45 }
46
47 return userBitness === '64' ? 'x64' : 'x86';
48};
49
50/**
51 * Retrieves high entropy values from User-Agent Client Hints API

Callers 4

DownloadLinkFunction · 0.90
PlatformDropdownFunction · 0.90
DownloadButtonFunction · 0.90
userAgent.test.mjsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected