Download wp-calypso/packages/data-stores/src/theme/utils.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 306 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/packages/data-stores/src/theme/utils.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/packages/data-stores/src/theme/utils.ts
-
curl -L -o utils.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/packages/data-stores/src/theme/utils.ts
306 Bytes
| /** | |
| * Given a theme stylesheet string (like 'pub/twentysixteen'), returns the corresponding theme ID ('twentysixteen'). | |
| */ | |
| export const getThemeIdFromStylesheet = ( stylesheet: string ) => { | |
| const [ , slug ] = stylesheet?.split( '/', 2 ) ?? []; | |
| if ( ! slug ) { | |
| return stylesheet; | |
| } | |
| return slug; | |
| }; | |