( value: unknown, )
| 72 | } |
| 73 | |
| 74 | function sanitizeApiIntegrationsSettings( |
| 75 | value: unknown, |
| 76 | ): PreferencesStore['api']['integrations'] { |
| 77 | const source = asRecord(value) |
| 78 | |
| 79 | return { |
| 80 | enabled: |
| 81 | typeof source.enabled === 'boolean' |
| 82 | ? source.enabled |
| 83 | : API_INTEGRATIONS_DEFAULTS.enabled, |
| 84 | tokenHash: readNullableString( |
| 85 | source, |
| 86 | 'tokenHash', |
| 87 | API_INTEGRATIONS_DEFAULTS.tokenHash, |
| 88 | ), |
| 89 | tokenPreview: readNullableString( |
| 90 | source, |
| 91 | 'tokenPreview', |
| 92 | API_INTEGRATIONS_DEFAULTS.tokenPreview, |
| 93 | ), |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | function sanitizeCodeEditorSettings(value: unknown): EditorSettings { |
| 98 | const source = asRecord(value) |
no test coverage detected