MCPcopy Index your code
hub / github.com/massCodeIO/massCode / sanitizeNotesEditorSettings

Function sanitizeNotesEditorSettings

src/main/store/module/preferences.ts:145–183  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

143}
144
145function 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
185function sanitizeMarkdownSettings(value: unknown): MarkdownSettings {
186 const source = asRecord(value)

Callers 1

sanitizePreferencesFunction · 0.85

Calls 3

asRecordFunction · 0.90
readNumberFunction · 0.90
readStringFunction · 0.90

Tested by

no test coverage detected