Download wp-calypso/client/landing/stepper/utils/use-snake-cased-keys.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 364 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/landing/stepper/utils/use-snake-cased-keys.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/landing/stepper/utils/use-snake-cased-keys.ts
-
curl -L -o use-snake-cased-keys.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/landing/stepper/utils/use-snake-cased-keys.ts
364 Bytes
| import { useMemo } from '@wordpress/element'; | |
| import { convertToSnakeCase } from 'calypso/state/data-layer/utils'; | |
| interface Params { | |
| input?: Record< string, unknown >; | |
| } | |
| const useSnakeCasedKeys = ( { input }: Params ) => { | |
| return useMemo( () => input && ( convertToSnakeCase( input ) as Params[ 'input' ] ), [ input ] ); | |
| }; | |
| export default useSnakeCasedKeys; | |