Download wp-calypso/client/landing/stepper/utils/devtools.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 758 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/landing/stepper/utils/devtools.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/landing/stepper/utils/devtools.ts
-
curl -L -o devtools.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/landing/stepper/utils/devtools.ts
758 Bytes
| interface MagicWindow extends Window { | |
| wp: undefined | Record< string, any >; | |
| } | |
| // Don't complain about window.wp.data types in our debug function | |
| declare const window: undefined | MagicWindow; | |
| export const setupWpDataDebug = () => { | |
| if ( process.env.NODE_ENV !== 'production' ) { | |
| if ( typeof window === 'object' ) { | |
| if ( ! window.wp ) { | |
| window.wp = {}; | |
| } | |
| if ( ! window.wp.data ) { | |
| window.wp.data = require( '@wordpress/data' ); | |
| const config = require( '@automattic/calypso-config' ).default; | |
| const clientCreds = { | |
| client_id: config( 'wpcom_signup_id' ), | |
| client_secret: config( 'wpcom_signup_key' ), | |
| }; | |
| const { Site } = require( '@automattic/data-stores' ); | |
| Site.register( clientCreds ); | |
| } | |
| } | |
| } | |
| }; | |