* Find the latest git-modified date for any file under a directory.
(gitDates, relativeDirPath)
| 124 | * Find the latest git-modified date for any file under a directory. |
| 125 | */ |
| 126 | function getDirectoryLastUpdated(gitDates, relativeDirPath) { |
| 127 | const prefix = `${relativeDirPath}/`; |
| 128 | let latestDate = null; |
| 129 | let latestTime = 0; |
| 130 | |
| 131 | for (const [filePath, date] of gitDates.entries()) { |
| 132 | if (!filePath.startsWith(prefix)) continue; |
| 133 | const timestamp = Date.parse(date); |
| 134 | if (!Number.isNaN(timestamp) && timestamp > latestTime) { |
| 135 | latestTime = timestamp; |
| 136 | latestDate = date; |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | return latestDate; |
| 141 | } |
| 142 | |
| 143 | /** |
| 144 | * Get the current commit SHA for the checked-out repository. |
no outgoing calls
no test coverage detected