Download wp-calypso/client/data/activity-log/utils.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 542 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/data/activity-log/utils.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/data/activity-log/utils.js
-
curl -L -o utils.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/data/activity-log/utils.js
542 Bytes
| const KNOWN_FILTER_OPTIONS = [ | |
| 'action', | |
| 'after', | |
| 'aggregate', | |
| 'before', | |
| 'by', | |
| 'dateRange', | |
| 'group', | |
| 'name', | |
| 'notGroup', | |
| 'number', | |
| 'on', | |
| 'sortOrder', | |
| 'textSearch', | |
| ]; | |
| export function getFilterKey( filter ) { | |
| return KNOWN_FILTER_OPTIONS.filter( ( opt ) => filter[ opt ] !== undefined ) | |
| .map( ( opt ) => { | |
| const optionValue = filter[ opt ]; | |
| const cacheKeyValue = Array.isArray( optionValue ) | |
| ? optionValue.slice().sort().join( ',' ) | |
| : optionValue; | |
| return `${ opt }=${ cacheKeyValue }`; | |
| } ) | |
| .join( '-' ); | |
| } | |