react-code-dataset / wp-calypso /client /state /data-layer /wpcom /read /site /post-email-subscriptions /utils.js
react-code-dataset / wp-calypso /client /state /data-layer /wpcom /read /site /post-email-subscriptions /utils.js
Download wp-calypso/client/state/data-layer/wpcom/read/site/post-email-subscriptions/utils.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 256 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/data-layer/wpcom/read/site/post-email-subscriptions/utils.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/state/data-layer/wpcom/read/site/post-email-subscriptions/utils.js
-
curl -L -o utils.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/data-layer/wpcom/read/site/post-email-subscriptions/utils.js
256 Bytes
| import { includes } from 'lodash'; | |
| export function buildBody( frequency ) { | |
| const validFrequencies = [ 'instantly', 'daily', 'weekly' ]; | |
| if ( includes( validFrequencies, frequency ) ) { | |
| return { | |
| delivery_frequency: frequency, | |
| }; | |
| } | |
| return {}; | |
| } | |