* Reports unsafe ownership or write permissions for a file path.
(filePath: string)
| 174 | * Reports unsafe ownership or write permissions for a file path. |
| 175 | */ |
| 176 | async function getUnsafeFileReason(filePath: string): Promise<string | null> { |
| 177 | const stats = await stat(filePath); |
| 178 | |
| 179 | if (!stats.isFile()) { |
| 180 | return 'not a file'; |
| 181 | } |
| 182 | |
| 183 | return getUnsafeStatsReason(stats); |
| 184 | } |
| 185 | |
| 186 | /** |
| 187 | * Reports unsafe ownership or write permissions from filesystem metadata. |
no test coverage detected