Download wp-calypso/client/lib/analytics/utils/is-url-excluded-for-performance.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 596 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/lib/analytics/utils/is-url-excluded-for-performance.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/lib/analytics/utils/is-url-excluded-for-performance.js
-
curl -L -o is-url-excluded-for-performance.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/lib/analytics/utils/is-url-excluded-for-performance.js
596 Bytes
| import debug from './debug'; | |
| // For better load performance, these routes are excluded from loading ads. | |
| const excludedRoutes = [ '/log-in' ]; | |
| /** | |
| * Are tracking pixels forbidden from the given URL for better performance (except for Google Analytics)? | |
| * @returns {boolean} true if the current URL is excluded. | |
| */ | |
| export default function isUrlExcludedForPerformance() { | |
| const { href } = document.location; | |
| const match = ( pattern ) => href.indexOf( pattern ) !== -1; | |
| const result = excludedRoutes.some( match ); | |
| debug( `Is URL Excluded for Performance: ${ result }` ); | |
| return result; | |
| } | |