2022-03-18 00:13:35 +01:00
|
|
|
import find from 'lodash/find';
|
|
|
|
|
|
|
|
export const isItemARequest = (item) => {
|
2022-03-18 18:27:18 +01:00
|
|
|
return item.hasOwnProperty('request') && ['http-request', 'graphql-request'].includes(item.type);
|
|
|
|
};
|
|
|
|
|
|
|
|
export const isItemAFolder = (item) => {
|
|
|
|
return !item.hasOwnProperty('request') && item.type === 'folder';
|
2022-03-18 00:13:35 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
export const itemIsOpenedInTabs = (item, tabs) => {
|
|
|
|
return find(tabs, (t) => t.uid === item.uid);
|
|
|
|
};
|