Download wp-calypso/client/lib/analytics/utils/get-exceptions.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 490 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/lib/analytics/utils/get-exceptions.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/lib/analytics/utils/get-exceptions.ts
-
curl -L -o get-exceptions.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/lib/analytics/utils/get-exceptions.ts
490 Bytes
| import cookie from 'cookie'; | |
| import type { AdTracker } from '../tracker-buckets'; | |
| const getExceptions = (): Partial< Record< AdTracker, boolean > > => { | |
| const cookies = cookie.parse( document.cookie ); | |
| const region = ( cookies.region || '' ).toLowerCase(); | |
| const countryCode = ( cookies.country_code || '' ).toLowerCase(); | |
| if ( ! region || ! countryCode ) { | |
| return {}; | |
| } | |
| return { | |
| facebook: region === 'california' && countryCode === 'us', | |
| }; | |
| }; | |
| export default getExceptions; | |