(value: unknown)
| 143 | } |
| 144 | |
| 145 | function sanitizeNotesEditorSettings(value: unknown): NotesEditorSettings { |
| 146 | const source = asRecord(value) |
| 147 | |
| 148 | return { |
| 149 | fontSize: readNumber( |
| 150 | source, |
| 151 | 'fontSize', |
| 152 | PREFERENCES_DEFAULTS.editor.notes.fontSize, |
| 153 | ), |
| 154 | fontFamily: readString( |
| 155 | source, |
| 156 | 'fontFamily', |
| 157 | PREFERENCES_DEFAULTS.editor.notes.fontFamily, |
| 158 | ), |
| 159 | codeFontFamily: readString( |
| 160 | source, |
| 161 | 'codeFontFamily', |
| 162 | PREFERENCES_DEFAULTS.editor.notes.codeFontFamily, |
| 163 | ), |
| 164 | lineHeight: readNumber( |
| 165 | source, |
| 166 | 'lineHeight', |
| 167 | PREFERENCES_DEFAULTS.editor.notes.lineHeight, |
| 168 | ), |
| 169 | limitWidth: |
| 170 | typeof source.limitWidth === 'boolean' |
| 171 | ? source.limitWidth |
| 172 | : PREFERENCES_DEFAULTS.editor.notes.limitWidth, |
| 173 | lineNumbers: |
| 174 | typeof source.lineNumbers === 'boolean' |
| 175 | ? source.lineNumbers |
| 176 | : PREFERENCES_DEFAULTS.editor.notes.lineNumbers, |
| 177 | indentSize: readNumber( |
| 178 | source, |
| 179 | 'indentSize', |
| 180 | PREFERENCES_DEFAULTS.editor.notes.indentSize, |
| 181 | ), |
| 182 | } |
| 183 | } |
| 184 | |
| 185 | function sanitizeMarkdownSettings(value: unknown): MarkdownSettings { |
| 186 | const source = asRecord(value) |
no test coverage detected