Download wp-calypso/client/sections-filter.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 477 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/sections-filter.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/sections-filter.js
-
curl -L -o sections-filter.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/sections-filter.js
477 Bytes
| import config from '@automattic/calypso-config'; | |
| export default function isSectionEnabled( section ) { | |
| return isSectionNameEnabled( section.name ); | |
| } | |
| export function isSectionNameEnabled( sectionName ) { | |
| const activeSections = config( 'sections' ); | |
| const byDefaultEnableSection = config( 'enable_all_sections' ); | |
| if ( activeSections && typeof activeSections[ sectionName ] !== 'undefined' ) { | |
| return activeSections[ sectionName ]; | |
| } | |
| return byDefaultEnableSection; | |
| } | |