(name: string, timestamp = 0)
| 25 | }; |
| 26 | |
| 27 | export const addRecentRepositories = (name: string, timestamp = 0) => { |
| 28 | const currentRecord = { name, timestamp: timestamp || Date.now() }; |
| 29 | const restRecords = getRecentRepositories().filter((record) => record.name !== name); |
| 30 | const newRecords = [currentRecord, ...restRecords.slice(0, 49)]; // max to 50 records |
| 31 | return getExtensionContext().globalState.update(RECENT_REPOSITORIES, newRecords); |
| 32 | }; |
| 33 | |
| 34 | export const removeRecentRepository = (name: string) => { |
| 35 | const newRecords = getRecentRepositories().filter((record) => record.name !== name); |
no test coverage detected