/
githubmirror
/
wp-calypso
Обзор
Документация
Войти
/
githubmirror
/
wp-calypso
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
client/data/activity-log/utils.js
28 строк
552 B
Eoin Gallagher
Activity Log: add Performed by filter to the wordpress.com filterbar (#110769)
20 май 2026, 16:53
Не верифицирован
20 май 2026, 16:53
19e020e
Код
Авторство
О чём код?
const KNOWN_FILTER_OPTIONS = [ 'action', 'actor', '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( '-' ); }