(value: unknown)
| 214 | } |
| 215 | |
| 216 | function sanitizeHttpSettings(value: unknown): HttpSettings { |
| 217 | const source = asRecord(value) |
| 218 | |
| 219 | return { |
| 220 | wrapLines: |
| 221 | typeof source.wrapLines === 'boolean' |
| 222 | ? source.wrapLines |
| 223 | : HTTP_DEFAULTS.wrapLines, |
| 224 | defaultPreviewFormat: readEnum( |
| 225 | source, |
| 226 | 'defaultPreviewFormat', |
| 227 | ['http', 'curl'] as const, |
| 228 | HTTP_DEFAULTS.defaultPreviewFormat, |
| 229 | ), |
| 230 | autoSwitchToResponse: |
| 231 | typeof source.autoSwitchToResponse === 'boolean' |
| 232 | ? source.autoSwitchToResponse |
| 233 | : HTTP_DEFAULTS.autoSwitchToResponse, |
| 234 | skipCertificateVerification: |
| 235 | typeof source.skipCertificateVerification === 'boolean' |
| 236 | ? source.skipCertificateVerification |
| 237 | : HTTP_DEFAULTS.skipCertificateVerification, |
| 238 | } |
| 239 | } |
| 240 | |
| 241 | function sanitizePreferences(value: unknown): PreferencesStore { |
| 242 | const source = asRecord(value) |
no test coverage detected