()
| 129 | |
| 130 | // Returns a list of tab Ids sorted by recency, most recent tab first. |
| 131 | getTabsByRecency() { |
| 132 | if (!this.loaded) throw new Error("TabRecency hasn't yet been loaded."); |
| 133 | const ids = Object.keys(this.tabIdToCounter); |
| 134 | ids.sort((a, b) => this.tabIdToCounter[b] - this.tabIdToCounter[a]); |
| 135 | return ids.map((id) => parseInt(id)); |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | export { TabRecency }; |
no outgoing calls
no test coverage detected