Download wp-calypso/apps/notifications/src/panel/rest-client/bump-stat.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 682 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/apps/notifications/src/panel/rest-client/bump-stat.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/apps/notifications/src/panel/rest-client/bump-stat.js
-
curl -L -o bump-stat.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/apps/notifications/src/panel/rest-client/bump-stat.js
682 Bytes
| export const bumpStat = ( group, name ) => { | |
| let uriComponent = ''; | |
| if ( undefined === group ) { | |
| return; | |
| } | |
| if ( typeof group === 'object' ) { | |
| for ( const key in group ) { | |
| if ( typeof group[ key ] === 'string' ) { | |
| uriComponent += | |
| '&x_' + encodeURIComponent( key ) + '=' + encodeURIComponent( group[ key ] ); | |
| } | |
| } | |
| } else if ( typeof group === 'string' && typeof name === 'string' ) { | |
| uriComponent = '&x_' + encodeURIComponent( group ) + '=' + encodeURIComponent( name ); | |
| } | |
| if ( uriComponent.length ) { | |
| new Image().src = | |
| document.location.protocol + | |
| '//pixel.wp.com/g.gif?v=wpcom-no-pv' + | |
| uriComponent + | |
| '&baba=' + | |
| Math.random(); | |
| } | |
| }; | |