Download wp-calypso/client/lib/analytics/ad-tracking/debug.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 458 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/lib/analytics/ad-tracking/debug.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/lib/analytics/ad-tracking/debug.js
-
curl -L -o debug.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/lib/analytics/ad-tracking/debug.js
458 Bytes
| export function circularReferenceSafeJSONStringify( json, space ) { | |
| try { | |
| let cache = []; | |
| const str = JSON.stringify( | |
| json, | |
| function ( key, value ) { | |
| if ( typeof value === 'object' && value !== null ) { | |
| if ( cache.indexOf( value ) !== -1 ) { | |
| return 'Circular reference'; | |
| } | |
| cache.push( value ); | |
| } | |
| return value; | |
| }, | |
| space | |
| ); | |
| cache = null; | |
| return str; | |
| } catch ( e ) { | |
| return 'Error: ' + e.message; | |
| } | |
| } | |