MCPcopy Create free account
hub / github.com/adobe/react-spectrum / testPlatform

Function testPlatform

packages/@react-aria/test-utils/src/utils.ts:18–22  ·  view source on GitHub ↗
(re: RegExp)

Source from the content-addressed store, hash-verified

16
17export const DEFAULT_LONG_PRESS_TIME = 500;
18function testPlatform(re: RegExp) {
19 return typeof window !== 'undefined' && window.navigator != null
20 ? re.test(window.navigator['userAgentData']?.platform || window.navigator.platform)
21 : false;
22}
23
24function cached(fn: () => boolean) {
25 if (process.env.NODE_ENV === 'test') {

Callers 1

utils.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected