* Saves command to recently used commands * @param {string} command Command name * @returns {void}
(command)
| 53 | * @returns {void} |
| 54 | */ |
| 55 | push(command) { |
| 56 | const { commands } = this; |
| 57 | if (commands.length > 10) { |
| 58 | commands.pop(); |
| 59 | } |
| 60 | if (commands.includes(command)) { |
| 61 | commands.splice(commands.indexOf(command), 1); |
| 62 | } |
| 63 | commands.unshift(command); |
| 64 | localStorage.setItem("recentlyUsedCommands", JSON.stringify(commands)); |
| 65 | }, |
| 66 | }; |
| 67 | } |
nothing calls this directly
no outgoing calls
no test coverage detected