MCPcopy Index your code
hub / github.com/adobe/react-spectrum / testPlatform

Function testPlatform

packages/react-aria/src/utils/platform.ts:25–29  ·  view source on GitHub ↗
(re: RegExp)

Source from the content-addressed store, hash-verified

23}
24
25function testPlatform(re: RegExp) {
26 return typeof window !== 'undefined' && window.navigator != null
27 ? re.test(window.navigator['userAgentData']?.platform || window.navigator.platform)
28 : false;
29}
30
31function cached(fn: () => boolean) {
32 if (process.env.NODE_ENV === 'test') {

Callers 1

platform.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected