MCPcopy
hub / github.com/massCodeIO/massCode / sanitizeApiIntegrationsSettings

Function sanitizeApiIntegrationsSettings

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

Source from the content-addressed store, hash-verified

72}
73
74function 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
97function sanitizeCodeEditorSettings(value: unknown): EditorSettings {
98 const source = asRecord(value)

Callers 1

sanitizePreferencesFunction · 0.85

Calls 2

asRecordFunction · 0.90
readNullableStringFunction · 0.90

Tested by

no test coverage detected