Function
shouldValidateFile
(
option: FileVerificationOption | undefined,
isLocal: boolean,
)
Source from the content-addressed store, hash-verified
| 170 | } |
| 171 | |
| 172 | function shouldValidateFile( |
| 173 | option: FileVerificationOption | undefined, |
| 174 | isLocal: boolean, |
| 175 | ): option is FileVerificationOption { |
| 176 | if (option === true) { |
| 177 | return true; |
| 178 | } |
| 179 | if (typeof option === 'object' && option !== null) { |
| 180 | if (isLocal) { |
| 181 | return Boolean(option.local); |
| 182 | } |
| 183 | return Boolean(option.remote); |
| 184 | } |
| 185 | return false; |
| 186 | } |
| 187 | |
| 188 | /** |
| 189 | * `isLocal` tells whether files are accessed on the machine the server runs on, |
Tested by
no test coverage detected