Function
shouldValidateFile
(
option: FileVerificationOption | undefined,
isLocal: boolean,
)
Source from the content-addressed store, hash-verified
| 145 | } |
| 146 | |
| 147 | function shouldValidateFile( |
| 148 | option: FileVerificationOption | undefined, |
| 149 | isLocal: boolean, |
| 150 | ): option is FileVerificationOption { |
| 151 | if (option === true) { |
| 152 | return true; |
| 153 | } |
| 154 | if (typeof option === 'object' && option !== null) { |
| 155 | if (isLocal) { |
| 156 | return Boolean(option.local); |
| 157 | } |
| 158 | return Boolean(option.remote); |
| 159 | } |
| 160 | return false; |
| 161 | } |
| 162 | |
| 163 | /** |
| 164 | * `isLocal` tells whether files are accessed on the machine the server runs on, |
Tested by
no test coverage detected