tripnomics_7.5.5/public/app/features/api-keys/state/selectors.ts
venbatechnologies@gmail.com 91fce5c4bf Initial commit
2021-07-05 13:49:40 +05:30

12 lines
328 B
TypeScript

import { ApiKeysState } from 'app/types';
export const getApiKeysCount = (state: ApiKeysState) => state.keys.length;
export const getApiKeys = (state: ApiKeysState) => {
const regex = RegExp(state.searchQuery, 'i');
return state.keys.filter((key) => {
return regex.test(key.name) || regex.test(key.role);
});
};