bruno/renderer/utils/tabs/index.js

14 lines
395 B
JavaScript
Raw Normal View History

import find from 'lodash/find';
export const isItemARequest = (item) => {
return item.hasOwnProperty('request') && ['http-request', 'graphql-request'].includes(item.type);
};
export const isItemAFolder = (item) => {
return !item.hasOwnProperty('request') && item.type === 'folder';
};
export const itemIsOpenedInTabs = (item, tabs) => {
return find(tabs, (t) => t.uid === item.uid);
};