TABS is always a dictionary
This commit is contained in:
		
							parent
							
								
									ea6dd9be93
								
							
						
					
					
						commit
						fc8983c646
					
				
					 1 changed files with 34 additions and 32 deletions
				
			
		|  | @ -34,7 +34,9 @@ export default class Tabs { | |||
| 		let TABS = {}; | ||||
| 
 | ||||
| 		TABS.all = await chrome.tabs.query(filters); | ||||
|           TABS.result = ((Array.isArray(TABS.all) ? (TABS.all).length > 0 : false) && ((index != null && (typeof index).includes(`num`)) ? index >= 0 : false)) ? TABS.all[index] : ((Array.isArray(TABS.all) ? (TABS.all).length > 0 : false) ? TABS.all : null); | ||||
| 		TABS.result = (index != null) | ||||
| 			? TABS.all[Math.abs(parseFloat(index))] | ||||
| 			: TABS.all; | ||||
| 
 | ||||
| 		return (TABS.result); | ||||
| 	} | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue